Re: An implementation of a short syntax for closures
| From: | Frédéric Hardy | Date: | Thu, 04 Aug 2011 08:50:32 +0000 |
| Subject: | Re: An implementation of a short syntax for closures | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-54340@lists.php.net to get a copy of this message | ||
Hello !
I've always thought that just supressing the "function" keyword could work as a shorthand, i.e. having ([param1 [, param2 [, ...]]]){...}. Somewhat similar to Ruby's lambda shorthand: http://slideshow.rubyforge.org/ruby19.html#40 Huge +1 for that.Code using closures will be more readable.
Moreover, it's more Perl/Ruby way than PHP way. Best regards, Fred -- ======================================================================== Frédéric Hardy : Architecte d'application/Admin. système/Ergonome CV : http://blog.mageekbox.net/public/cv.frederic.hardy.pdf Blog : http://blog.mageekbox.net Twitter : http://twitter.com/mageekguy ========================================================================$add = | $x |=> | $y : $x |=> $x+$y;Not sure that it's really readable.