Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99456 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 72047 invoked from network); 8 Jun 2017 15:57:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Jun 2017 15:57:11 -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 77.244.243.83 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 77.244.243.83 mx102.easyname.com Received: from [77.244.243.83] ([77.244.243.83:44846] helo=mx102.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B4/63-27119-4D379395 for ; Thu, 08 Jun 2017 11:57:10 -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 1dIzo2-0005Ow-3A; Thu, 08 Jun 2017 15:57:06 +0000 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> To: php-internals , Rasmus Schultz Message-ID: <40dc6de9-7e05-e043-e8e3-9e93409be2bd@fleshgrinder.com> Date: Thu, 8 Jun 2017 17:56:53 +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="n1f9LWj9Q86IHFdhNRvxCoCeKRFUaUoeA" X-DNSBL-PBLSPAMHAUS: YES Subject: Re: [PHP-DEV] [RFC]Discuss] Syntax for Arrow Functions From: php@fleshgrinder.com (Fleshgrinder) --n1f9LWj9Q86IHFdhNRvxCoCeKRFUaUoeA Content-Type: multipart/mixed; boundary="nMrWLGpTV49BbOF6bwe6ki7KLNkD8IWsL"; protected-headers="v1" From: Fleshgrinder To: php-internals , Rasmus Schultz Message-ID: <40dc6de9-7e05-e043-e8e3-9e93409be2bd@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> <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> In-Reply-To: --nMrWLGpTV49BbOF6bwe6ki7KLNkD8IWsL Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 6/7/2017 9:45 PM, Rasmus Schultz wrote: >> the `fn($a, $b) =3D> $a + $b ** $c` syntax suddenly becomes an accepta= ble > compromise. >=20 > I have to second that. >=20 > I might even propose to shorten it from "fn" to just "f" - the resultin= g > syntax then resembles a mathematical predicate :-) >=20 I really like your thinking here. +1 for just `f`. I am not sure why we would require the fat arrow anymore. We most probably want some symbol there to separate the return type constraint from the body, but it could be a single symbol instead of two: f($x) =3D $x^3 f(int $x): int =3D $x^3 We could go full math here! :) --=20 Richard "Fleshgrinder" Fussenegger --nMrWLGpTV49BbOF6bwe6ki7KLNkD8IWsL-- --n1f9LWj9Q86IHFdhNRvxCoCeKRFUaUoeA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJZOXPMAAoJEOKkKcqFPVVrPdoQAIygMNQ/Ea85zEEFWxKKD03Y dbTVm9xL6vC7xtArIIMwECrwIvRWN+QrSUdCCqgIKAShHEg99FLW3rlbzqjFNZmY TAyoUv7aMROUv1Npl8NmvBWf0cAu5hxql4qNpgCV020l2IxuiJKuva85gqBhyRgY pIhVm28Z2MMUPtczw6HtcrkavZGDaFWNUdjEXKv90/ekDA6jg90WuN5bC4Yc+SCO iUL8h4hpE7IXtp3NI93IsSwJF24p2/kdl4UNJYy2mhTVr+bKrvl1Ag7kGgr8Dril WECcmnz5pcMkVCZSTyor8FQ1ZLvOetSEeJBcTIllI2DpCsnJdDqon1fNAaLfwwmZ 1/gdkDBsGd3VM4yugqHFQQuCakDy0zHn2wO06hrv2DAhxRXw9+lngN6h0qbl8EE8 oOxWTF956vBN6dnsi2SQO7XS9T9Z8Dio2E8zJTyawqJXAB0FNxYY4tlg28aViKbE Z1QvN0C17StW1JaMjSliqs28CgxT1w8HEw6hMAOfMnF/bOEhQsnIHDvd4G28yEd3 vGUJwMRWRbR8RwA9a+tgGx9Jk47MWad+OjmWfXZmLOSm0R5udInnWqtrYi4Bxboi OuEog1nQpKwZfuAtbmdm4H5YZKI2aO/uPfo+OsGkwCygSQTY4FeCWKPJq97siZAE CjVgn/7eb+/wp4X9e4vc =7Clm -----END PGP SIGNATURE----- --n1f9LWj9Q86IHFdhNRvxCoCeKRFUaUoeA--