Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99454 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60041 invoked from network); 8 Jun 2017 12:33:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Jun 2017 12:33:29 -0000 Authentication-Results: pb1.pair.com header.from=bjorn.x.larsson@telia.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=bjorn.x.larsson@telia.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain telia.com from 81.236.60.155 cause and error) X-PHP-List-Original-Sender: bjorn.x.larsson@telia.com X-Host-Fingerprint: 81.236.60.155 v-smtpout2.han.skanova.net Received: from [81.236.60.155] ([81.236.60.155:36339] helo=v-smtpout2.han.skanova.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 14/52-27119-71449395 for ; Thu, 08 Jun 2017 08:33:28 -0400 Received: from [192.168.7.8] ([195.198.188.252]) by cmsmtp with SMTP id IwctdlXyzpjp6Iwcudif2j; Thu, 08 Jun 2017 14:33:24 +0200 To: Stephen Reay Cc: Ryan Pallas , Fleshgrinder , PHP internals References: <7eaef49b-bf60-9aa1-e812-8430164e3178@garfieldtech.com> <3F920987-38CB-42DD-888D-824430C36F14@gmail.com> <2f9e73c9-444a-11d0-459a-e261ea8a7080@telia.com> <4077c099-2247-c3c1-7dee-02a6b25f8586@fleshgrinder.com> <559b73f7-c40f-e593-f0e1-51b56210d7cb@telia.com> <2053A608-6B66-42FB-A6D7-7CC64E94DA6A@koalephant.com> <4FBDE643-1EBC-485A-A39F-7E28C5D4807A@koalephant.com> Message-ID: Date: Thu, 8 Jun 2017 14:33:22 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <4FBDE643-1EBC-485A-A39F-7E28C5D4807A@koalephant.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: sv X-CMAE-Envelope: MS4wfKVQvw16DR5jWKHv8mN696eU1KUjwuulHGCJZU9VeRlPp2ct3bGi6YQQNZS2nOkwDxx1cdksfVwpd5pZuPxB9vJ3tkS4EP8hNkca8nZG81UIJLpNXxeZ TYHlZ0gd6WFFBjCWmbN4N995kj4WaWaY+Tscpe643uhAs7pEF9tWVNyAmhlGFOsANQnhrtWov9zSy/Cwgd/TdgxQ7VEd7eCoLeqnH0I9DEjN/5GPQg7OIf2q wyvWVZGfh35lc5oGZPFD44EhiiM6xp+JfkPrRkn+rhPvTC/QUmN1VDNpOdAdt2ex Subject: Re: [PHP-DEV] [RFC]Discuss] Syntax for Arrow Functions From: bjorn.x.larsson@telia.com (=?UTF-8?Q?Bj=c3=b6rn_Larsson?=) Den 2017-06-07 kl. 17:20, skrev Stephen Reay: >> On 7 Jun 2017, at 20:37, Björn Larsson wrote: >> >> Well, one reason to use fn or even lambda was to signal that this is >> different then a regular function. >> >> When it comes to number of keystrokes I guess that some inspiration >> has been taken from other languages supporting arrow functions, like >> Javascript & HACK. >> >> I also recall from earlier discussions, that with less keystrokes it's easier >> to read when an arrow function is embedded / chained into another >> expression / statement / function call. >> > I think its pretty clear my pref is/was #2, but when compared to the crazy alternatives people have been suggesting, which just seem to be “hold down shift and blindly poke at the non-letter keys for a while”, the `fn($a, $b) => $a + $b ** $c` syntax suddenly becomes an acceptable compromise. > Yup, I also think that one is better then function. One reason (not the only one) for me to advocate ==> syntax is that it's the same syntax as HACK. However, apparently this one requires more of the parser and it's tricky if typehints comes into the equation. Still my favourite one is option 3 if it would be possible to implement. r//Björn