Re: [RFC]Discuss] Syntax for Arrow Functions
| From: | Sara Golemon | Date: | Thu, 08 Jun 2017 16:22:20 +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 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-99457@lists.php.net to get a copy of this message | ||
On Thu, Jun 8, 2017 at 9:34 AM, Rowan Collins <rowan.collins@gmail.com> wrote:
> On 08/06/2017 13:33, Björn Larsson wrote:
>>
>> One reason
>> (not the only one) for me to advocate ==> syntax is that it's the
>> same syntax as HACK
>
>
> I'm not a fan of this logic. Using Hack as a kind of prototyping-ground for
> PHP features is fine, but since they don't have the same decision-making
> process as us, we should be looking at the *result* of their experience, not
> just following their lead. It may seem a subtle difference, but to me
> "because that choice has worked out well in Hack" is a much stronger
> argument than "because the small team working on Hack chose it that way a
> few years ago".
>
> In this case, there's some reason to question if it *has* worked out well in
> Hack, given that IIRC they had to hack (no pun intended) their parser to
> implement it.
>
This is true. The bodge to make (args...) ==> expr work in HackLang
isn't worthy of replicating in PHP. If we can do it without a hack*
then by all means, let's not diverge the implementations. But I
didn't want to maintain that lexer "is it a T_OP or a '('?" mess in
HHVM, I don't wanna maintain it in PHP either.
-Sara