Re: [RFC] Short syntax for anonymous functions

From: Date: Tue, 19 Feb 2013 13:20:55 +0000
Subject: Re: [RFC] Short syntax for anonymous functions
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Marcello,


On Tue, Feb 19, 2013 at 7:57 AM, Marcello Duarte <[email protected]> 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


Thread (65 messages)

« previous php.internals (#65940) next »