Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105224 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 96728 invoked from network); 10 Apr 2019 23:59:27 -0000 Received: from unknown (HELO v-smtpout2.han.skanova.net) (81.236.60.155) by pb1.pair.com with SMTP; 10 Apr 2019 23:59:27 -0000 Received: from [192.168.7.8] ([213.64.245.126]) by cmsmtp with ESMTPA id EKGuh8ZRBEqdOEKGuhIyZf; Wed, 10 Apr 2019 22:56:40 +0200 To: Rowan Collins References: <582b57dc-42a0-582b-9471-2ede97ba584a@telia.com> Cc: PHP internals Message-ID: <7a13ab70-9cca-10cd-ba81-5c9db3989689@telia.com> Date: Wed, 10 Apr 2019 22:56:41 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-CMAE-Envelope: MS4wfOjlH+XAPt18QQ+FWodTbAgzDOeXkTPZugA9h7e5ZDHU7EZNxFegIhER0CiN+xWGZvpvMFsb9pZXvJNIXDKQUNcKdnyQCbyl+YENUn27u8TINdJvgSu9 YrUc8fFP7Uf6xODXVpz3WXtLkfOvXo0zNipBfWXa4O1c5ytlMyFwS05Vj2eMvxAlxg9TfzBuWmOAN72CmVf03/7JUqkM6GrQuZi1wh178wa9s7Zc27m7iJ2e Subject: Re: [PHP-DEV] Re: [RFC] Arrow functions / short closures From: bjorn.x.larsson@telia.com (=?UTF-8?Q?Bj=c3=b6rn_Larsson?=) Den 2019-04-10 kl. 10:39, skrev Rowan Collins: > On Tue, 9 Apr 2019 at 11:20, Nikita Popov wrote: > >> The ==> syntax is the other one I implemented ( >> https://github.com/php/php-src/pull/3945). The implementation is based on >> lexer lookahead, which is ugly but still manageable. I haven't seen much >> support for this variant in this discussion though. And of course, if >> there's no strong preference for ==>, I'd rather go with the variant that >> is easier for us (and all 3rd party tooling) to support from a technical >> perspective. >> > > I'd just like to amplify this mention of 3rd party tooling: if we go with > something which requires complex lexer/parser rules, then every editor, > IDE, and static analysis tool will need to also work with that syntax. > > For those saying they "slightly prefer" ==> please ask yourself, do you > prefer it enough to add complexity to every tool that wants to process PHP > source code? > > Regards, Hi, Could then the \($x) syntax be a good compromise between readability & implementation? It also has the advantage of having less BC impact, since the fn keyword must be a full keyword according to RFC. As a side note I'm thinking on if the Hacklang implementation could shed some light on tooling issues that they got, due to their implementation of the ==> syntax. r//Björn L