Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98160 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18572 invoked from network); 4 Feb 2017 00:26:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Feb 2017 00:26:04 -0000 Authentication-Results: pb1.pair.com smtp.mail=aaron@trowski.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=aaron@trowski.com; 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:55685] helo=mercury.negativeion.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AC/3C-38491-B9F15985 for ; Fri, 03 Feb 2017 19:26:04 -0500 Received: from localhost (localhost [127.0.0.1]) by mercury.negativeion.net (Postfix) with ESMTP id 00F294758875; Fri, 3 Feb 2017 19:26:01 -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 VEDmuIzDpuRe; Fri, 3 Feb 2017 19:26:00 -0500 (EST) Received: from [10.0.1.3] (unknown [192.119.134.23]) by mercury.negativeion.net (Postfix) with ESMTPSA id 83B264758867; Fri, 3 Feb 2017 19:26:00 -0500 (EST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) In-Reply-To: <611b72db-420f-4963-ab92-0ddf977a0aaa@Spark> Date: Fri, 3 Feb 2017 18:25:59 -0600 Cc: internals Content-Transfer-Encoding: quoted-printable Message-ID: <9AF0D2F6-D668-418C-8B96-3320D9D245ED@trowski.com> References: <19.45.38491.677D4985@pb1.pair.com> <611b72db-420f-4963-ab92-0ddf977a0aaa@Spark> To: ilija.tovilo@me.com 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 2:34 PM, ilija.tovilo@me.com wrote: >=20 > I like the suggested syntax. The only drawback I see is that it = inhibits the future addition of union types for closures: >=20 > |int | float $x| =3D> $x >=20 > Adding parentheses of course resolves the issue but looks a bit = awkward: >=20 > |(int | float) $x| =3D> $x >=20 > Apart from that I have nothing to complain about. I'd be happy either = way. >=20 While it may be ugly, I do not believe that this has any ambiguity. $callback =3D |int|float $x| =3D> $x ** 2; When the second | is not followed by =3D>, the parser should be able to = discern that a union type is being used. Regards, Aaron Piotrowski=