Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88533 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98233 invoked from network); 28 Sep 2015 21:29:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Sep 2015 21:29:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=bjorn.x.larsson@telia.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=bjorn.x.larsson@telia.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain telia.com from 81.236.60.154 cause and error) X-PHP-List-Original-Sender: bjorn.x.larsson@telia.com X-Host-Fingerprint: 81.236.60.154 v-smtpout1.han.skanova.net Received: from [81.236.60.154] ([81.236.60.154:41857] helo=v-smtpout1.han.skanova.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9C/B1-17200-041B9065 for ; Mon, 28 Sep 2015 17:29:37 -0400 Received: from [192.168.7.4] ([195.198.188.252]) by cmsmtp with SMTP id gfzJZax1P9HQVgfzJZwAIb; Mon, 28 Sep 2015 23:29:33 +0200 To: =?UTF-8?Q?Pavel_Kou=c5=99il?= References: Cc: PHP internals Message-ID: <5609B140.1050102@telia.com> Date: Mon, 28 Sep 2015 23:29:36 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfAT54bV7z5VVUFYWtgyfkX8iWxT9sUdB8z9C/YF3LeIfMbTjpNrt/eGh7O9XYGF4s/nKUCLy26Sx4FMr7+meUCe9x4+frXc3SETQ0ztxDqHpso/Lee2/OL6zyeUoH1jpixupoNrYdYES7jz69wi9/uy/uT5VMeIJkeXohGsVBCWcBfPEeOADvhKjATpJiSa6L3tqQnCRRbbSi6bWasO06Feb0UL4loVHyr4R1aQ0z+37 Subject: Re: [PHP-DEV] [RFC] [VOTE] Short Closures From: bjorn.x.larsson@telia.com (=?UTF-8?Q?Bj=c3=b6rn_Larsson?=) Den 2015-09-26 kl. 09:18, skrev Pavel Kouřil: > On Tue, Sep 22, 2015 at 3:59 AM, Bob Weinand wrote: >> Hey, >> >> Thanks for all your feedback in the discussion thread! >> >> So, before I start the vote, just two quick notes: >> I've added two notes about the statement syntax and the single variable use. >> Though a few people complained, I'm not switching to the ==> operator, as I noticed many people expected typehints to work (they don't due to parser limitations) when they compared to Hack's short Closures. It also allows us to differ syntax-wise [e.g. for typehints] from Hack without causing any confusion later. Which should be the smartest choice: Avoid conflicts. (If anyone strongly feels against that, he may vote no, but I would like to not bikeshed that in this Vote thread, but leave it free for eventual actual issues.) >> >> Now, the link to the RFC about Short Closures: >> https://wiki.php.net/rfc/short_closures >> or straight ahead to the vote: >> https://wiki.php.net/rfc/short_closures#vote >> >> Thanks, >> Bob >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> > Hello, > > since the RFC doesn't look like it will pass, I have a question about > RFC process - will you be able to "fix" the RFC and submit it for vote > again with targeting PHP 7.1? > > The biggest issues seem to be > - ~> operator instead of ==> > - missing type hints > - auto imports > > If probably the first two would be resolved, then maybe the RFC could > get accepted? I personally don't understand the 3rd complain, since > having to use() everything would make it "not-so-short closures". > > I also remember people not liking the option not to have parenthesis > with single parameter. I was thinking about this, and with the type > hints, it would be probably better anyways to have the ( ) required, > so that would be just a single use case where they wouldn't be > required - so is there a point in keeping this special use case? > > Regards > Pavel Kouřil > A good strategy. Suspect that fixing type hints & reach consensus on auto import or not is enough to make it pass, maybe also parenthesis. I don't think ~> or ==> is cruical but then I personally favour ~> because I find it more distinct, not confusing it with => or <=>. Also having ==> might lead the thought that functionality is like == vs ===. Hm... or if someday in the future comparison operator without type juggling is needed. Regards //Björn Larsson