On Tue, Feb 19, 2013 at 6:40 PM, Levi Morrison <morrison.l...@gmail.com>wrote:
> > Say we agree on the syntax above > >> ($n) |$m| => $m * $n; > > What happens when my one liner function needs to do one more operation > > like checking the value of $n before multiplication? > > As I stated before suggesting the syntax: It's only meant for a single > expression. It's purposefully NOT intended to cover multiple > expressions. In that case the current (verbose) syntax is better for > all criteria I care about. Additionally, neither Python nor Dart > allows multiple expressions in their short-syntax functions. > > +1 A similar syntax was applied in C# lambads. For example : m => m * n. Though C# allows to use code block in lambdas, I do think that we should focus on one-expression only, since the current callbacks syntax (function() { }) is great, I believe, for multiline code. > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >