Re: [RFC][Discuss] Arrow Functions

From: Date: Mon, 30 Jan 2017 23:31:15 +0000
Subject: Re: [RFC][Discuss] Arrow Functions
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-98058@lists.php.net to get a copy of this message
On Mon, Jan 30, 2017 at 4:05 PM, Rowan Collins <rowan.collins@gmail.com> wrote: > On 30/01/2017 17:55, Levi Morrison wrote: >> >> Bob Weinand and I are happy to announce that the [Arrow Functions][1] >> RFC is moving into the public discussion phase. We have been >> collaborating on this RFC for many months now and finally have a >> proposal we are happy to discuss in the open. >> >> [1]: https://wiki.php.net/rfc/arrow_functions > > > Firstly, I like this proposal a lot more than the previous, so thank you for > working on this based on previous discussion. In particular, I'm glad to see > it focused on single expressions with implicit return, as I think that's > where it has most value. > > A few comments: > >> ThisRFC does support type declarations for parameters and return types. > > > An example of the syntax for this would be good, particularly how the return > type fits the syntax (which may conflict with my suggestion below). They go in the same places as regular functions. I'll update the RFC later with examples, but for now here is an example that takes an integer and returns it, which type declarations: fn (int $x): int => $x

« previous php.internals (#98058) next »