« first day (4932 days earlier)   
09:00 - 20:0020:00 - 00:00

8:32 PM
Lol. Not sure if that was intentional. :)
@Crell I think PHPs internal functions are just so bad that even with pipes/pfa it's still going to look bad. I think pipes for anything but collections and strings is a bit niche, so I wonder if a good iterator api might get us most of the way there. I'd also be interested to see whether an internal iterator api with closures is actually fast enough (as f-calls have non-negligible overhead).
 
So this is interesting (by-ref in an array passed into a function, essentially doing call-time pass-by-ref removed since PHP 5.4): 3v4l.org/ErCrS Anyone has any idea what's going on?
I'd expect same output as here 3v4l.org/5ZqG8
 
@OndřejMirtes Array elements can be by-ref, so this is what I'd expect. We can't really remove that without major breakage.
Maybe I'm misunderstanding.
 
8:50 PM
@IluTov I don't know, seeing it like that makes me wonder why was even call-time pass-by-ref removed when this is still possible.
Also it's interesting that this syntax isn't mentioned at all at php.net/manual/en/language.types.array.php
 
Yeah, that's a new one to me
I thought it would have been the same as: 3v4l.org/9ftLT but it isn't
 
@OndřejMirtes Right. Arrays containing references is a big red flag, outside of a foreach by-ref (probably including, actually :P)
@Girgias The reference is unwrapped in [$r], you need a & there to maintain it.
 
Blergh
 
One of the few good things about references ^^
 
References are confusing AF
picks up some torches to light up and burn references
 
 
2 hours later…
10:38 PM
@IluTov Yeah, the APIs are bad, and everyone keeps saying we need to redo them, but we never do, because we can't agree how to. That said, I disagree that collections and strings are the only places for pipes. They're a common case, but not the only.
What Elixir does may actually be the prettiest approach for PHP: foo |> bar(baz) translates to bar(foo, baz). It effectively does a hard coded partial and then immediately calls it.
That would still allow for SA or compile-time type checks, avoid the need for a PFA syntax, and be infinitely extensible. You'd just need to write functions such that the first argument is equivalent to $this, basically, like many other languages do. Which... yes, means some of the existing functions will not work, but frankly, I'm OK with that. We can take that as an opportunity to redesign them to new versions like we keep talking about, like taking an iterable rather than an array.
 
JRL
11:05 PM
33-1. wow. i did not expect it to be this stark based on the discussion.
still unaccounted for no votes out there, but its been long enough i would expect more to be there
 
09:00 - 20:0020:00 - 00:00

« first day (4932 days earlier)