Re: [RFC]Discuss] Syntax for Arrow Functions
| From: | Rowan Collins | Date: | Tue, 20 Jun 2017 17:52:07 +0000 |
| Subject: | Re: [RFC]Discuss] Syntax for Arrow Functions | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-99578@lists.php.net to get a copy of this message | ||
On 19 June 2017 21:22:53 BST, Rasmus Schultz <rasmus@mindplay.dk> wrote:
>So what's on the table is a syntax-improved but feature-crippled
>variant of
>closures, not an all-round replacement?
I haven't the time right now to dig out my summary from the mail archives, but this is one of
the fundamental disagreements / misunderstandings that made discussion difficult the first time:
different people want very different things from this feature, leading to conflicting views on
whether certain things are advantages or disadvantages.
For me (and I am not alone), this feature is NOT a new syntax for closures. It is a new TYPE of
closure, with new semantics - automatically capturing variables - for a specific use case.
Personally, I am strongly opposed to any multi-line version of it, because I don't want the
fundamental scoping rules of the language changed except for the specific case of simple lambda
expressions.
If what you are looking for is a replacement syntax for existing closures, you will have a
completely different set of priorities. That doesn't make either of us wrong, but it does mean
we're going to find it very hard to agree on a syntax and feature set.
Regards,
--
Rowan Collins
[IMSoP]