Re: [RFC] Short syntax for anonymous functions

From: Date: Tue, 19 Feb 2013 13:22:26 +0000
Subject: Re: [RFC] Short syntax for anonymous functions
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-65942@lists.php.net to get a copy of this message
I also am not in favour of the syntax, it's too short and quirky. I'm honestly fine with 'function()' it's very explicit On Tue, Feb 19, 2013 at 1:20 PM, Anthony Ferrara <ircmaxell@gmail.com>wrote: > Marcello, > > > On Tue, Feb 19, 2013 at 7:57 AM, Marcello Duarte <mduarte@inviqa.com> > wrote: > > > Inspired by Sara, here is another RFC, I finally got around to draft: > > > > > > https://wiki.php.net/rfc/short-syntax-for-anonymous-function > > > > Please feedback, > > -- > > Marcello Duarte > > > > > I like the concept. I dislike the syntax. It looks too much like a JSON > object declaration, and it feels like it should be returning an object > instead of a closure/anonymous function. Additionally, I don't like that > it's also a closure. Short functions like this should be for simple > functions... > > Perhaps: > > lambda $x: trim($x); > > $x: trim($x); > > Or something similar... > > Anthony >

« previous php.internals (#65942) next »