Re: Re: [RFC][Discuss] Arrow Functions
| From: | David Rodrigues | Date: | Fri, 03 Feb 2017 18:46:49 +0000 |
| Subject: | Re: Re: [RFC][Discuss] Arrow Functions | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-98139@lists.php.net to get a copy of this message | ||
Hello folks!
I just not understand why "function" should be abbreviated. It's about "how
less character better"? I don't see it too much on PHP. I guess that is
more simple keep what exists current "function", that all knows about (that
should be better than the next example):
$mapped = array_map(function($x) => $x + $y); // vs current:
$mapped = array_map(function($x) use($y) { return $x + $y });
Or even, I too don't know why just ($x) => is an issue. There some possible
conflict why that?
2017-02-03 16:21 GMT-02:00 Michael Morris <tendoaki@gmail.com>:
> On Fri, Feb 3, 2017 at 12:53 PM, Levi Morrison <levim@php.net> wrote:
> >
> > > To that end, I'd like to gauge interest in a pure syntax based
> > > alternative that is similar to Rust and Ruby.
> > > Instead of:
> > >
> > > fn(params) => expr
> > >
> > > What about:
> > >
> > > |params| => expr
> >
>
> Looks great to me from up here in the peanut gallery.
>
--
David Rodrigues