Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87977 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26502 invoked from network); 1 Sep 2015 07:36:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Sep 2015 07:36:47 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.51 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.192.51 mail-qg0-f51.google.com Received: from [209.85.192.51] ([209.85.192.51:33526] helo=mail-qg0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F8/FB-39890-D8555E55 for ; Tue, 01 Sep 2015 03:36:46 -0400 Received: by qgp105 with SMTP id 105so33019106qgp.0 for ; Tue, 01 Sep 2015 00:36:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=bkKdWSecM3MpOCYrge8oeUe+OBIV2LdF2gvR0lVxymg=; b=a2EzOMZiASEnctKStx2dtKXHC/n83bQIiGuJQj0smvRORGVjh8nIQ4Ss3hRJw7JF3m 7xCc+f3tmCgQB91zdxuarnzctlU772/98UD82ras5hf8RcogA3vsDghNFJ5/1AVcVBn+ O2XzXFmO5bZSZGarXOI8vdTepxcwFchvlZaGFz4IwrzQN+nYhqmVf2VOgkHGUocU3S91 qrSrm0RKJMjJcSqzT3nzNfwtecXnUOqPNByJmnpu9JD7Hau2+6t4SFSsEpDr6DhqkRI4 2nthy8C/W3F+juP0OvOVPILFELuVkyVYvhbHLG/6nYZotoYJgXIjmOW4WwbqFU8xCPgn Lw3A== X-Received: by 10.13.234.138 with SMTP id t132mr26421379ywe.89.1441093001898; Tue, 01 Sep 2015 00:36:41 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.129.81.87 with HTTP; Tue, 1 Sep 2015 00:36:02 -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 16:36:02 +0900 X-Google-Sender-Auth: U3XNfXYDe6HWqn0TKcoHlH13QtM Message-ID: To: Anthony Ferrara Cc: Stanislav Malyshev , Bob Weinand , "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] [Discussion] Short Closures From: yohgaki@ohgaki.net (Yasuo Ohgaki) 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) ==> $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 => x + 1 > C#: x => 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 "==>"? Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net