Den 2017-05-30 kl. 17:09, skrev Levi Morrison:

Well, my preference would be for alternative 3. Not in favour of 2 & 4.
Nr 1 not so sure about and for nr 5, maybe tweak it to:
- [](params) ==> expr    // binds no values
- [=](params) ==> expr    // binds by value
- [&](params) ==> expr    // binds by reference
Can you explain why you want a longer arrow?
To improve readability and also make it less ambiguous for
the programmer / reader of code. Also I think it stands out
more in code reviews and if one by mistake looses [], would
it then generate a parsing error or be treated as valid syntax.

Maybe also a bit simpler to implement then "[]() => expr"
in the PHP engine, but I'm guessing on this one though...
Leaving out [] could also be a default:
- (params) ==> expr    // binds no values
Or maybe that is why?
Yup, one reason!
I presume then that the options discussed earlier "|params| => expr"
and "lamda(params) => expr" are of the table.
The `|params| => expr` syntax is off the table, yes. I don't remember
anyone taking the `lambda(params) => expr` suggestion seriously; my
apologies if I'm simply remembering this incorrectly.

I recall some liking it (like me ;-) since it's a clearer signal
then fn(params) that we have something different here.

r//Björn

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to