Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99295 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38426 invoked from network); 31 May 2017 13:36:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 May 2017 13:36:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.42 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.42 mail-wm0-f42.google.com Received: from [74.125.82.42] ([74.125.82.42:38754] helo=mail-wm0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B2/5C-43873-9E6CE295 for ; Wed, 31 May 2017 09:36:41 -0400 Received: by mail-wm0-f42.google.com with SMTP id e127so20747253wmg.1 for ; Wed, 31 May 2017 06:36:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:to:from:message-id; bh=5Hj3FsyeD6M/yO4BOoeOrwehhIP+CGpWUSyLrjCI/xw=; b=aMCDBmAl1zsmPSwdrpQQj90EhhmaRp43Zxw0ONO1YjHraLs/JCf1V4nrsxNHHCUvgl sSddz+1061MBSHDCw01SQINM+n2rGdpSpfNWF1+jKwFWxtqEEhwZVkz3jd7nvps1QDPb 1q7nctSWdOLDNnrhihhe7R0hCfA3ZGVNklDUjGErT51nPe37MnYikm8ZEzHFxgAMXAK+ rRlgeUJ/6ya2Y2bVqNjnjtQpbY/QrDLMQEN0FhjogsPtQXKSX/FFRnODFLyZ7BV5PZGU P2wGK0nNUAKle4w56jLDGVGnyizjfpSdabUHFarlvh1GTpD3Z/OV6vYmyFd15Ke7LN1W NCNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:from:message-id; bh=5Hj3FsyeD6M/yO4BOoeOrwehhIP+CGpWUSyLrjCI/xw=; b=br6tmD8ZaUT2V1qVhmbwL3CRF9FugLg2V9+MFZ+Dz0G31BmAOaQxgn/XSUCyiaW3j1 tRkSdX3paUM2KbUXV/3EV1Pjtj5bxu3A5e15fjG2o7STH9GoTwk0/3tjJL7bOZyjvAGd EfS+dpWX9EwsIPhW1q7sgaV4++Tn/8bpSPh+I7FzzGSmTnMu5gIKbnJ/TYQVNScvUUN0 FYvu2JWQA6Yqa9PN8vg6qPta2RMo9mJdxkCZSfkLEyPjZzd87Sr4KNZL1GSDxk4/yZUx T4bOmAH0JtFIDqBfmRNPwd080mA4b19QxB0gfUzPZYjmpDahQ/eLzBDWsRsOur5X8IBq u91Q== X-Gm-Message-State: AODbwcDTvrLPAh0plmyrudQrD/lQLRTq5w7NgGP3VaOKd1PV6Cg5ep15 jIXsuxK+Ss5aIuVpZl4= X-Received: by 10.223.169.171 with SMTP id b40mr5495171wrd.147.1496237798347; Wed, 31 May 2017 06:36:38 -0700 (PDT) Received: from [10.61.77.213] (188.29.165.101.threembb.co.uk. [188.29.165.101]) by smtp.gmail.com with ESMTPSA id g46sm718246wrg.69.2017.05.31.06.36.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 May 2017 06:36:37 -0700 (PDT) Date: Wed, 31 May 2017 14:36:34 +0100 User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable To: internals@lists.php.net Message-ID: <934DD9E3-FACE-4BE0-A40F-0B240FE5D186@gmail.com> Subject: Re: [PHP-DEV] [RFC]Discuss] Syntax for Arrow Functions From: rowan.collins@gmail.com (Rowan Collins) On 30 May 2017 18:58:14 BST, Levi Morrison wrote: >Internals, > >The previous discussion thread has died down significantly and so I'd >like to start a new one to refocus=2E This message has some redundant >information by design so people don't have to reference the other >thread so much=2E > >Based on the discussion there are a few different syntax choices >people liked=2E Overall it's a feature that people seem to want but >everyone seems to prefer a different syntax choice=2E I was just pondering alternative approaches to stop the =3D> token being a= mbiguous, and wondered if surrounding the whole expression with braces coul= d work: { =3D> $bound * 2 } { $a, $b =3D> $a * $b } I believe this eliminates the ambiguity with array notation, and is more c= oncise than pretty much every alternative=2E I'm my opinion, grouping the a= rguments and body would make it more readable in context, as well=2E The only potential difficulty with parsing would be that this would techni= cally be valid: if ( $test ) { $a =3D> $a * 5 }; Because it means this: if ( $test ) { function ($a) { return $a * 5; }; } It's not ambiguous, but I don't know if this and similar constructs would = cause problems with backtracking in the parser=2E Worst case, they could pr= obably be defined as illegal, since it's pretty hard to construct a use cas= e for such a thing=2E Regards, --=20 Rowan Collins [IMSoP]