Re: [RFC] Short syntax for anonymous functions

From: Date: Tue, 19 Feb 2013 17:54:00 +0000
Subject: Re: [RFC] Short syntax for anonymous functions
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
@Marcello: actually, I am also of the idea that there's no real additional
value in such a syntax...

Since I'm using ZF2 (yeah, that framework that converts array to
applications) I am kinda used to have dozens of function () {} closures
for service factories: so far no problems with it.

As stated before, it spares 9 chars while the end developer (devops or
whoever coding instead of of the devops) loses a lot of readability that is
not really such a big problem.

Also, as it is for DSLs, you could always use a parser to handle this kind
of thing in your own domain.

What exactly is the limit that you see when applying the more verbose
function () {} syntax? I am just wondering since moving to {} will
still not make this portable to any platform except PHP itself.


Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/


Thread (65 messages)

« previous php.internals (#65980) next »