Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99374 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23689 invoked from network); 5 Jun 2017 18:52:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jun 2017 18:52:21 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 212.232.28.122 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 212.232.28.122 mx201.easyname.com Received: from [212.232.28.122] ([212.232.28.122:43663] helo=mx201.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 82/25-27119-368A5395 for ; Mon, 05 Jun 2017 14:52:19 -0400 Received: from cable-81-173-132-37.netcologne.de ([81.173.132.37] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1dHx6u-00016V-ET; Mon, 05 Jun 2017 18:52:16 +0000 References: <6357d97c-3f2e-4cf8-cb1f-cb7f7ccccf7c@telia.com> <7eaef49b-bf60-9aa1-e812-8430164e3178@garfieldtech.com> <3F920987-38CB-42DD-888D-824430C36F14@gmail.com> <2f9e73c9-444a-11d0-459a-e261ea8a7080@telia.com> To: rasmus@mindplay.dk, php-internals Message-ID: <4077c099-2247-c3c1-7dee-02a6b25f8586@fleshgrinder.com> Date: Mon, 5 Jun 2017 20:52:05 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fN1M5jrxAooLIL7oKUl7OxcEQfxMIcedk" X-DNSBL-PBLSPAMHAUS: YES Subject: Re: [PHP-DEV] [RFC]Discuss] Syntax for Arrow Functions From: php@fleshgrinder.com (Fleshgrinder) --fN1M5jrxAooLIL7oKUl7OxcEQfxMIcedk Content-Type: multipart/mixed; boundary="GkejjkQ6clfh0WkA2ds8fTSKbh5jEG5Ee"; protected-headers="v1" From: Fleshgrinder To: rasmus@mindplay.dk, php-internals Message-ID: <4077c099-2247-c3c1-7dee-02a6b25f8586@fleshgrinder.com> Subject: Re: [PHP-DEV] [RFC]Discuss] Syntax for Arrow Functions References: <6357d97c-3f2e-4cf8-cb1f-cb7f7ccccf7c@telia.com> <7eaef49b-bf60-9aa1-e812-8430164e3178@garfieldtech.com> <3F920987-38CB-42DD-888D-824430C36F14@gmail.com> <2f9e73c9-444a-11d0-459a-e261ea8a7080@telia.com> In-Reply-To: --GkejjkQ6clfh0WkA2ds8fTSKbh5jEG5Ee Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 6/5/2017 8:36 PM, Rasmus Schultz wrote: > Ugh, you're right, that's totally unreadable... the =3D> is far too amb= iguous > with array syntax, I agree. >=20 > How about just a thin arrow? >=20 > (params) -> expr >=20 > If the parens around params were required, it's not ambiguous with the > trailing -- operator, is it? >=20 > $foo->bar(($baz) -> $baz + 1); >=20 > Consistent use of parens around the params might make closures a bit ea= sier > to spot in the wild? >=20 This would actually work with everything, me likes. () -> 42 ($a, $b) -> $a + $b ($a) (&$b) -> $b +=3D $a public static Foo() -> new static('Foo'); It also avoid any association with