Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99563 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19706 invoked from network); 19 Jun 2017 20:22:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jun 2017 20:22:58 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@mindplay.dk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@mindplay.dk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mindplay.dk from 209.85.192.180 cause and error) X-PHP-List-Original-Sender: rasmus@mindplay.dk X-Host-Fingerprint: 209.85.192.180 mail-pf0-f180.google.com Received: from [209.85.192.180] ([209.85.192.180:34440] helo=mail-pf0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 35/8C-13828-1A238495 for ; Mon, 19 Jun 2017 16:22:57 -0400 Received: by mail-pf0-f180.google.com with SMTP id s66so58788008pfs.1 for ; Mon, 19 Jun 2017 13:22:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mindplay-dk.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=rV108NdyQMl7v3fpIYbu6OD2rgyz7s7tA5DPGY+qgkE=; b=xgCfK82jE0yHNY8dGA8iX4nH/CFo+LtYIqXM2M8S2KEJJPZ61BnXJg0DbzRfJSKo7u VBZx64XN6exOnrPy0Mmcg5dmqtVETdU9BaA6z/G8SxnNjHJMG84fUS/e1Cyf9+Svwenp jrh/i/tTl7F0czDhd/a3SpDeNCbDMICuE83ycIZYyU6B8OaREB2cVv9EWRp0eJ+ypImI VIS1aJ3MefevVFiuuKiSoXd5/wVuJ9kSWfSB9edn2zknINjfxk63m6A+T9sh8GVGsO6M KK6u5wVYuz3oMqP5lVUinHtSj+y8Tq/GwGWrEUKTAT/GeFjw3BKXi1Po8UGD3PUZLnQj 9PcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=rV108NdyQMl7v3fpIYbu6OD2rgyz7s7tA5DPGY+qgkE=; b=gQicxyp1qu9iEorLqrZDjWTy/j6rUCKSrYOZ80DFIGySl2ocWd94HquAno+ibuvxhd t0vB7g92v4ZlfxXUx/vYxoXjTbUYViRxGCFoBEwVAYQcL7elR0rqjcEn/H9zk5Mz2FvH FCnmeB8k/ZFyUEPESYJWYbXbfSyhl9FFEFNjfyi3t6S5ly+K2sMjxfi2IY1+7ci4Ng6L IgwrpZixdLO94a+MLUcIGwVphRW0okZnHkNgd6VGEmmtiFq+d3cGG/+HHyzVVQcdFE1E a1WgaqDeRhQV1hpJE2DXW3lolagu1oIuP9G6LSfZw6nsMZLVZ7R6zwTBG01ND6sYX3yG y1PQ== X-Gm-Message-State: AKS2vOxvWhryK2k3E9/hYJfN99G8rj5J2s/aDPcfh32PTCq9eDW53ga3 kFgPXM+SD1up+u+xBz6w7/pXt1o+t/rEXnI3oA== X-Received: by 10.99.18.65 with SMTP id 1mr28314678pgs.132.1497903773905; Mon, 19 Jun 2017 13:22:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.151.167 with HTTP; Mon, 19 Jun 2017 13:22:53 -0700 (PDT) In-Reply-To: <2d89daaa-056f-3dcb-a5f2-b790affe203a@garfieldtech.com> References: <5fe1eefe-1c4f-4c31-c975-ab6c768c977c@telia.com> <3C763609-54FC-480B-AE95-94A1873226E0@me.com> <9A3447BF-F982-4C5A-B55B-466036AF2E53@me.com> <2d89daaa-056f-3dcb-a5f2-b790affe203a@garfieldtech.com> Date: Mon, 19 Jun 2017 22:22:53 +0200 Message-ID: To: Larry Garfield Cc: PHP internals Content-Type: multipart/alternative; boundary="001a114d114c5a0a5e055255e6d2" Subject: Re: [PHP-DEV] [RFC]Discuss] Syntax for Arrow Functions From: rasmus@mindplay.dk (Rasmus Schultz) --001a114d114c5a0a5e055255e6d2 Content-Type: text/plain; charset="UTF-8" So what's on the table is a syntax-improved but feature-crippled variant of closures, not an all-round replacement? If I have to factor back and forth between new and old syntax every time a closure changes from one to multiple or back to one statement, then, frankly, what's the point? I think I would just keep using the old syntax, then - for consistency, and to save myself the frustration of factoring back and forth. The old syntax is a burden, but a new feature with limited applicability, honestly, I think would be even more of a burden. In my opinion, if this is worth doing, it's worth doing it right. On Mon, Jun 19, 2017 at 10:12 PM, Larry Garfield wrote: > > > On 06/19/2017 03:45 PM, Rasmus Schultz wrote: > >> Or maybe it'll look okay if you format the code? >> >> $things->forEach({$v => { >> foo($v); >> bar($v); >> }}); >> >> Still looks kinda crazy with the closing "}})" though... >> > > Multi-line lambdas should use the existing syntax without changes. The > only thing being discussed here is single-statement lambdas that you would > want to inline and think of as an expression rather than a function call. > If you need something more complex than that just use the existing syntax. > > --Larry Garfield > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a114d114c5a0a5e055255e6d2--