>> And one thing that makes auto capture much better choice than explicit
>> capture (as it've been said a couple of times already) is partial
>> application:
>>
>>     $mul = fn($x) => fn($y) => fn($z) => $x * $y * $z;
>>
>> Looks simpler than:
>>
>>     $mul = fn($x) => fn($y; $x) => fn($z; $x, $y) => $x * $y * $z;
>>
>>
> Yes it looks simpler, but if this is going to continue being the argument
> for auto-capturing can we at least get a real world example? I have never
> once in the wild seen a lambda that returns a lambda that returns a lambda,
> all using variables from the previous lamba(s). I'm fairly certain no one
> will invoke the overhead of a function call 3 times just to multiply 3
> numbers together. Please give me a valid example if you want me to believe
> this to be a valid argument.

This is close: 
https://github.com/morrisonlevi/Algorithm/blob/master/src/reduce.php

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

Reply via email to