Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98171 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48632 invoked from network); 4 Feb 2017 07:15:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Feb 2017 07:15:51 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@ohgaki.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@ohgaki.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ohgaki.net designates 180.42.98.130 as permitted sender) X-PHP-List-Original-Sender: yohgaki@ohgaki.net X-Host-Fingerprint: 180.42.98.130 ns1.es-i.jp Received: from [180.42.98.130] ([180.42.98.130:49320] helo=es-i.jp) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E2/30-38491-3AF75985 for ; Sat, 04 Feb 2017 02:15:51 -0500 Received: (qmail 115264 invoked by uid 89); 4 Feb 2017 07:15:44 -0000 Received: from unknown (HELO mail-qt0-f170.google.com) (yohgaki@ohgaki.net@209.85.216.170) by 0 with ESMTPA; 4 Feb 2017 07:15:44 -0000 Received: by mail-qt0-f170.google.com with SMTP id v23so66542699qtb.0 for ; Fri, 03 Feb 2017 23:15:43 -0800 (PST) X-Gm-Message-State: AMke39kQQxtgTTRBjq+zzxkMEpI2osCGvnHhQv8/M7YihwBbzagJbSVPuqVJ9lnOPxkuYEorz6m06PCPdp5bDw== X-Received: by 10.200.35.105 with SMTP id b38mr713855qtb.1.1486192537808; Fri, 03 Feb 2017 23:15:37 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.19.232 with HTTP; Fri, 3 Feb 2017 23:14:57 -0800 (PST) In-Reply-To: References: Date: Sat, 4 Feb 2017 16:14:57 +0900 X-Gmail-Original-Message-ID: Message-ID: To: Levi Morrison Cc: internals Content-Type: multipart/alternative; boundary=001a11402d9448b6fb0547af2ac6 Subject: Re: [PHP-DEV] Re: [RFC][Discuss] Arrow Functions From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11402d9448b6fb0547af2ac6 Content-Type: text/plain; charset=UTF-8 Hi Levi, On Sat, Feb 4, 2017 at 2:53 AM, Levi Morrison wrote: > One more thing: I'd like to re-emphasize that the syntax that > JavaScript uses and the one that HHVM/Hack uses are ambiguous in the > current class of our grammar. The following will not work unless we > move to a more powerful grammar and parser class: > > (params) => expr > (params) ==> expr > > This is why an un-ambiguous prefix is necessary: the prefix breaks the > ambiguities. The syntax I have suggested in the RFC and the one I > suggested just now are not ambiguous because distinct prefixes: > Thanks for explanation. > an un-ambiguous prefix is necessary This is what I guessed. This should be emphasized and everyone should understand. Otherwise, discussion goes nowhere. > fn(params) => expr > |params| => expr > > I look forward to more discussion! > It's unfortunate we cannot have HHVM/Hack syntax now https://docs.hhvm.com/hack/lambdas/introduction but both fn(params) => expr |params| => expr would be good enough for now. I don't see much problem with |(int | float) params| => expr It's better to be compatible with other implementations if it is possible. PHP may have HHVM/Hack syntax support in the future. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11402d9448b6fb0547af2ac6--