Den 2017-06-07 kl. 17:20, skrev Stephen Reay:
On 7 Jun 2017, at 20:37, Björn Larsson <bjorn.x.lars...@telia.com> wrote:

Well, one reason to use fn or even lambda was to signal that this is
different then a regular function.

When it comes to number of keystrokes I guess that some inspiration
has been taken from other languages supporting arrow functions, like
Javascript & HACK.

I also recall from earlier discussions, that with less keystrokes it's easier
to read when an arrow function is embedded / chained into another
expression / statement / function call.

I think its pretty clear my pref is/was #2, but when compared to the crazy 
alternatives people have been suggesting, which just seem to be “hold down shift 
and blindly poke at the non-letter keys for a while”, the `fn($a, $b) => $a + 
$b ** $c` syntax suddenly becomes an acceptable compromise.

Yup, I also think that one is better then function. One reason
(not the only one) for me to advocate ==> syntax is that it's the
same syntax as HACK. However, apparently this one requires
more of the parser and it's tricky if typehints comes into the
equation.

Still my favourite one is option 3 if it would be possible to
implement.

r//Björn

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

Reply via email to