Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99272 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57961 invoked from network); 30 May 2017 18:08:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 May 2017 18:08:32 -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.156 cause and error) X-PHP-List-Original-Sender: bjorn.x.larsson@telia.com X-Host-Fingerprint: 81.236.60.156 v-smtpout3.han.skanova.net Received: from [81.236.60.156] ([81.236.60.156:35336] helo=v-smtpout3.han.skanova.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/12-43873-E15BD295 for ; Tue, 30 May 2017 14:08:30 -0400 Received: from [192.168.7.8] ([195.198.188.252]) by cmsmtp with SMTP id FlZCdLxCnARCaFlZCdYebz; Tue, 30 May 2017 20:08:27 +0200 To: Levi Morrison Cc: Sara Golemon , PHP internals References: <97bb5051-6413-b78a-e981-ad8858caec4c@gmail.com> <8d4ee559-1ad2-4d65-ae4f-207e59f056e3@Spark> <61DC1C28-CAF2-45F4-8D9F-A66BEA2E90B1@gmail.com> <3942113e-f83a-444f-bbc2-462c70d67c65@Spark> <20db9b97-5313-057d-db56-920ccb758558@telia.com> <877970f0-b22d-a8b9-9ad4-6fc9139a9b34@telia.com> Message-ID: <513cf5b4-34f4-a81a-83e8-f8d1fd6c0a19@telia.com> Date: Tue, 30 May 2017 20:08:29 +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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: sv X-CMAE-Envelope: MS4wfII+i2GKW4T8Bu7ZEJT55ZSqHyGMV4lN75FwSk7NsTn8M6TbGwkEgzi+HKngnMUSpnVQZXiUJJfInWrnzFl9PV6xGt9y/dy8bKTh1RHp3pAsaLAx+HTO 6CA4J7cwv04z/kD57RtQIzcvFpEtjzmHVg3B35L3a9I121zDTW3rz7Y9NDjFGaci6O5kN6Gts9LkVSzaIO59AuXnbiYN6uE3EprC4dWOfmnK3m1NFPjmud7C Subject: Re: [PHP-DEV] [RFC][Discuss] Arrow Functions From: bjorn.x.larsson@telia.com (=?UTF-8?Q?Bj=c3=b6rn_Larsson?=) Den 2017-05-30 kl. 17:09, skrev Levi Morrison: >> Well, my preference would be for alternative 3. Not in favour of 2 & 4. >> Nr 1 not so sure about and for nr 5, maybe tweak it to: >> - [](params) ==> expr // binds no values >> - [=](params) ==> expr // binds by value >> - [&](params) ==> expr // binds by reference > Can you explain why you want a longer arrow? To improve readability and also make it less ambiguous for the programmer / reader of code. Also I think it stands out more in code reviews and if one by mistake looses [], would it then generate a parsing error or be treated as valid syntax. Maybe also a bit simpler to implement then "[]() => expr" in the PHP engine, but I'm guessing on this one though... >> Leaving out [] could also be a default: >> - (params) ==> expr // binds no values > Or maybe that is why? Yup, one reason! >> I presume then that the options discussed earlier "|params| => expr" >> and "lamda(params) => expr" are of the table. > The `|params| => expr` syntax is off the table, yes. I don't remember > anyone taking the `lambda(params) => expr` suggestion seriously; my > apologies if I'm simply remembering this incorrectly. > I recall some liking it (like me ;-) since it's a clearer signal then fn(params) that we have something different here. r//Björn