Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99306 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70308 invoked from network); 31 May 2017 21:36:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 May 2017 21:36:11 -0000 Authentication-Results: pb1.pair.com smtp.mail=ilija.tovilo@me.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ilija.tovilo@me.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain me.com designates 17.142.194.250 as permitted sender) X-PHP-List-Original-Sender: ilija.tovilo@me.com X-Host-Fingerprint: 17.142.194.250 pv33p00im-asmtp001.me.com Received: from [17.142.194.250] ([17.142.194.250:54602] helo=pv33p00im-asmtp001.me.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4F/C0-43873-9473F295 for ; Wed, 31 May 2017 17:36:10 -0400 Received: from process-dkim-sign-daemon.pv33p00im-asmtp001.me.com by pv33p00im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OQU00600516WT00@pv33p00im-asmtp001.me.com> for internals@lists.php.net; Wed, 31 May 2017 21:35:51 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1496266551; bh=aEqDu98v5++qccz0aBdfht1SeGpLvms4jgTkh/LMjdk=; h=Date:From:To:Message-id:Subject:MIME-version:Content-type; b=KRvhAmVTjJO4sKKfFcFr5p3+l93/ietWUgLyz0XL2FVLIvFKkzTPaE083WrmnkE6E uI3A9AzpbkhUvyAH2i0NtlUno2Wub/J26hatM1ssP9+k89RQoXrcKCQmPdlq0AsfOu 1fk1sf4vOtClftMKLjiXRoKheGgCD6Ua/DEUwjrNJNPHYAMenB2H6F9RHatQ18LwUa W2Fr6xf0rYIcbDEgc1EkSgPNW8yq8sPNTwS4sQj9JhmHiA1r04HzJjbkrZEZ/9hkNQ v//lD+JYXFW1d+KJrj5aIkWp2XXNn/zDWLsn4rqw5aGm5OdSCGbGZ4uEZ1HAJJzTZ/ gs8yOPubTphSw== Received: from icloud.com ([127.0.0.1]) by pv33p00im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OQU00OE06NNEL30@pv33p00im-asmtp001.me.com>; Wed, 31 May 2017 21:35:50 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-05-31_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=23 spamscore=23 clxscore=1034 suspectscore=32 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1701120000 definitions=main-1705310386 Date: Wed, 31 May 2017 23:35:31 +0200 To: Levi Morrison Cc: internals , Rowan Collins Message-ID: <05a6b21a-4a99-4795-8bec-817516b2cd28@Spark> In-reply-to: References: X-Readdle-Message-ID: 05a6b21a-4a99-4795-8bec-817516b2cd28@Spark MIME-version: 1.0 Content-type: multipart/alternative; boundary=592f3731_3334a58_854b Subject: Re: [PHP-DEV] [RFC]Discuss] Syntax for Arrow Functions From: ilija.tovilo@me.com --592f3731_3334a58_854b Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I think it=E2=80=99s worth noting that the people most excited about arro= w functions are probably the ones with a more functional approach. Those kinds of side effects are usually avoided. I also have nothing against capturing by reference. Given the last exampl= e: fn(=24item) =3D> =24array=5B=5D =3D =24item All you have to do is glance a few characters to the left to see that =24= array is not a parameter and thus must be captured. And again, since it=E2= =80=99s pretty obvious to see if you=E2=80=99re mutating the variable (sp= ot the equal sign) this shouldn=E2=80=99t cause too many surprises. Only = scenario I can think of is passing it to another function as a reference.= But then again, no one ever complains about that in other languages. Ilija On 31 May 2017, 23:11 +0200, Levi Morrison , wrote: > > I can=E2=80=99t think of a scenario where capturing by reference woul= d be helpful in > > a single line closure. > > function(=24item) use(=24array) =7B > return =24array=5B=5D =3D =24item; > =7D > > It's actually one of the first closures I discovered in the wild when > looking for closures that would be candidates for the short form. --592f3731_3334a58_854b--