Re: [RFC]Discuss] Syntax for Arrow Functions
| From: | Sara Golemon | Date: | Fri, 09 Jun 2017 00:13:23 +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-99465@lists.php.net to get a copy of this message | ||
On Thu, Jun 8, 2017 at 4:56 PM, Björn Larsson <bjorn.x.larsson@telia.com> wrote:
> You have a good point here! I think one then should evaluate
> both the implementation, which apparently is not so great and
> how the feature itself has been received.
>
> I mean is it heavily used and what is the user feedback? E.g. are
> users happy with the syntax and how do they use it.
>
As I already mentioned, the HHVM implementation is hackish, but the
reception around Facebook about the feature itself was SUPER positive.
Particularly when paired with collections. $someDict->map($v ==> $v *
2)->filter($v ==> $v % 3); just reads way cleaner than the old
expressions.
FWIW, (with my HHVM hat on) we'd also discussed that we wouldn't be
too bothered if PHP went with a different syntax as it would ease
pressure to match behavior on a feature that's already widely deployed
internally. So don't worry about picking a symbol based on what Hack
uses. Pick what makes sense for PHP. For my part, I care FAR more
that we get short closures than what gymnastics my fingers have to
partake.
-Sara