Hi, 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
Regards, David On Thu, Aug 4, 2011 at 2:23 AM, Rasmus Lerdorf <ras...@lerdorf.com> wrote: > On 08/04/2011 12:08 AM, Lazare Inepologlou wrote: > > $add = | $x |=> | $y : $x |=> $x+$y; > > This does not seem to match the syntax of any language I know of so > people are going to have a hard time figuring out what this does. It's > not even clear that |=> is a new operator there due to the dangling |, > which as you say conflicts with the regular | operator. Plus it is only > useful in one limited type of trivial closure usage. > > In PHP we try really hard not to invent new unfamiliar syntax. We try to > stick with things that have some basis in either the existing syntax or > in other popular languages that the average PHP developer might be > exposed to. > > -Rasmus > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >