Besides, I mean, I'm sure this has occurred to everyone, right? https://gist.github.com/mindplay-dk/4ef61fd5c0a35e5aa8fc699febb86487
I personally find that this new syntax you're proposing requires a lot of parsing. I mean, whenever you see substr() or array_map() etc. you're intuitively expecting the first argument to be the first argument, right? Now you have to backtrack through other lines and figure out the context, or try to spot the $$ and count arguments to figure out which is which. Just using intermediary variables seems pretty straight-forward and harmless, so that would be my personal preference - if my coworkers started using this everywhere, I would likely refactor the code and introduce more variables in the process of trying to parse and make sense of it. IMO, shorter, isolated constructions are always easier to read, write, understand and change than the much longer constructions with the new operator shown in the RFC. But I also stay away from fluent APIs for the same reason, so there's that. Maybe it comes down to personal preference - it's definitely not to my taste, sorry... On Wed, Jan 25, 2017 at 7:06 AM, Stephen Reay <php-li...@koalephant.com> wrote: > As a userland developer I feel $$ (or some variation starting with $) is > reasonably natural - it's a variation on a regular variable. > > > > Sent from my iPhone > > > On 25 Jan 2017, at 03:53, Levi Morrison <le...@php.net> wrote: > > > >> On Tue, Jan 24, 2017 at 12:25 PM, Rasmus Schultz <ras...@mindplay.dk> > wrote: > >> Isn't `_` more generally used as a "discard" placeholder in most > languages? > >> > >> At least in Swift, Go, Scala, Dart and C# (starting with v7) I think? > >> > >> I don't recall having seen it mean "fill in the blank". In what > languages? > >> > >> > >>> On Fri, Jan 20, 2017 at 4:26 PM, Levi Morrison <le...@php.net> wrote: > >>> > >>> Oops, sorry for an email that just quotes others; mis-clicked send. > >>> > >>>> Last, a cosmetic suggestion : replace '$$' with '$<' (more explicit as > >>>> 'input data', imo). > >>> > >>> If we aren't going to use `$$` I'd like to use `_` or `__` which read > >>> similar to "fill in the blank" and has precedence in other languages. > >>> > >>> But at this stage I'd much rather focus on changing the general model > >>> to what I've proposed instead of what is outlined in the RFC. I care > >>> much more about the feature than the exact syntax for it. > >>> > >>> -- > >>> PHP Internals - PHP Runtime Development Mailing List > >>> To unsubscribe, visit: http://www.php.net/unsub.php > > > > Scala does use it this way. It also uses it in pattern matching to > > mean "match anything else" or "I don't care about this one". > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > >