Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87978 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28387 invoked from network); 1 Sep 2015 07:41:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Sep 2015 07:41:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.172 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.212.172 mail-wi0-f172.google.com Received: from [209.85.212.172] ([209.85.212.172:37824] helo=mail-wi0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8D/00-27722-7B655E55 for ; Tue, 01 Sep 2015 03:41:44 -0400 Received: by wicfx3 with SMTP id fx3so2366170wic.0 for ; Tue, 01 Sep 2015 00:41:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=lurugHTORtim9Ej8rSAlOLAGmM/Yi7o8ZiEukApjxlI=; b=T9WKyrMJqEaVKZeTafHrCQtC9VLy+jD1DWVyskdx+gAbVKFbhQORCxd1jk8+gY9mT0 RfSva3qKIaCzjZl8Y0iMQHIDnBlcBaYnSK8SprqChl/YOSyDABBqH8EWhbgIE1isgb8S lQ4Ch98VTvtoxZjHthKeEhFLHFXk9bLsAzGXIFDSAJiz44zCJ5ACfMh3MZi2iS4L2qpt cUNn6h9knFViHKwN6vXL9D6//G1+Uaal4SmR2LicF6xFqNjwE0q7F2Hn36J6qqYuNjtZ d6N/YBfZj2PMF8Oqr/xVyFcU2eK+Ixnp/m0C5AkbjrNMYFsaZ8PmRYCGHQ6rSZ4/i4bp /z5Q== MIME-Version: 1.0 X-Received: by 10.194.103.130 with SMTP id fw2mr34262607wjb.121.1441093300062; Tue, 01 Sep 2015 00:41:40 -0700 (PDT) Received: by 10.28.194.139 with HTTP; Tue, 1 Sep 2015 00:41:39 -0700 (PDT) In-Reply-To: References: <55E4C19F.4060704@gmail.com> <55E4F029.10104@gmail.com> <7BCB36EE-56C8-441F-BF40-954D9FA912A9@lerdorf.com> <55E51FAA.8030106@gmail.com> Date: Tue, 1 Sep 2015 09:41:39 +0200 Message-ID: To: Yasuo Ohgaki Cc: Anthony Ferrara , Stanislav Malyshev , Bob Weinand , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e0102ef543d10bd051eaaae7a Subject: Re: [PHP-DEV] [RFC] [Discussion] Short Closures From: tyra3l@gmail.com (Ferenc Kovacs) --089e0102ef543d10bd051eaaae7a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Sep 1, 2015 at 9:36 AM, Yasuo Ohgaki wrote: > Hi Anthony and Bob, > > On Tue, Sep 1, 2015 at 2:53 PM, Anthony Ferrara > wrote: > > Most programming languages today have a "short form" closure or lambda > syntax > > > > HackLang: ($x) =3D=3D> $x + 1; > > C++: [](int x) -> int { return x + 1; } > > Java: (int x) -> x + 1; > > Python: lambda x: x+1 > > Ruby: lambda |x| { x + 1 } > > Rust: |x| x + 1 > > JavaScript (ES6): x =3D> x + 1 > > C#: x =3D> x + 1 > > Objective C: ^(int x) { return x + 1; } > > Nice summary! > The syntax may look strange at first, but proposed syntax is close enough > to > other languages. There will be no barrier for our users in the long run. > > I thought scope variables enabled by default is destructive at first, > but Bob clarify > they are passed by value. Therefore, it would not be issue. > > Bob, is there reason not to use the same syntax as Hack "=3D=3D>"? > https://wiki.php.net/rfc/short_closures#symbol_choice --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu --089e0102ef543d10bd051eaaae7a--