Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98163 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29122 invoked from network); 4 Feb 2017 03:33:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Feb 2017 03:33:13 -0000 Authentication-Results: pb1.pair.com header.from=aaron@trowski.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=aaron@trowski.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain trowski.com designates 199.38.81.6 as permitted sender) X-PHP-List-Original-Sender: aaron@trowski.com X-Host-Fingerprint: 199.38.81.6 mercury.negativeion.net Received: from [199.38.81.6] ([199.38.81.6:56299] helo=mercury.negativeion.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 90/7D-38491-67B45985 for ; Fri, 03 Feb 2017 22:33:12 -0500 Received: from localhost (localhost [127.0.0.1]) by mercury.negativeion.net (Postfix) with ESMTP id 8970F475B034; Fri, 3 Feb 2017 22:33:07 -0500 (EST) X-Virus-Scanned: amavisd-new at negativeion.net Received: from mercury.negativeion.net ([127.0.0.1]) by localhost (mercury.negativeion.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c9EVV_VIMQLf; Fri, 3 Feb 2017 22:33:07 -0500 (EST) Received: from jupiter.local (unknown [173.225.150.231]) by mercury.negativeion.net (Postfix) with ESMTPSA id E6119475B025; Fri, 3 Feb 2017 22:33:06 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) In-Reply-To: <5722B01C-A621-4C13-B34B-383B0D9753F9@koalephant.com> Date: Fri, 3 Feb 2017 21:33:09 -0600 Cc: internals , ilija.tovilo@me.com Content-Transfer-Encoding: quoted-printable Message-ID: <22B18CB2-0383-4D4D-9B55-91A748725AC9@trowski.com> References: <19.45.38491.677D4985@pb1.pair.com> <611b72db-420f-4963-ab92-0ddf977a0aaa@Spark> <9AF0D2F6-D668-418C-8B96-3320D9D245ED@trowski.com> <5722B01C-A621-4C13-B34B-383B0D9753F9@koalephant.com> To: Stephen Reay X-Mailer: Apple Mail (2.3124) Subject: Re: [PHP-DEV] [RFC][Discuss] Arrow Functions From: aaron@trowski.com (Aaron Piotrowski) > On Feb 3, 2017, at 9:06 PM, Stephen Reay = wrote: >=20 >=20 >> On 4 Feb 2017, at 07:25, Aaron Piotrowski wrote: >>=20 >> $callback =3D |int|float $x| =3D> $x ** 2; >=20 > Forget the parser, you're giving my eyes diabetes trying to read that. I absolutely agree that it's terrible=E2=80=A6 the point is that types = (even potential future union types) can be used with short closures, but = it certainly doesn't mean they should be. I don't think confusion with a = non-existent and non-recommended way of coding should be a reason = against a particular syntax. > As has been said before, PHP is relatively verbose compared to other = languages. That makes it slightly more characters to type, but it also = makes it absolutely clear what is happening. Using `function` IMO makes it more likely to confuse a short closure = with a regular closure. Reusing the `function` keyword with different = semantics may result in some confusion. > As Niklas said, all ambiguity/clarity issues are solved by using = "function", at the cost of 6 characters. >=20 > Suggesting that a search for arrow functions will be easier with = and then using grep (which could also = easily match arrow functions using "function") as your example search = seems odd to me. I never suggested this, Bj=C3=B6rn Larsson did. Any of the possibilities = mentioned in this thread could easily be searched. Regards, Aaron Piotrowski