Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99377 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28452 invoked from network); 5 Jun 2017 19:03:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jun 2017 19:03:49 -0000 Authentication-Results: pb1.pair.com smtp.mail=derokorian@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=derokorian@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.182 as permitted sender) X-PHP-List-Original-Sender: derokorian@gmail.com X-Host-Fingerprint: 74.125.82.182 mail-ot0-f182.google.com Received: from [74.125.82.182] ([74.125.82.182:33500] helo=mail-ot0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 76/26-27119-51BA5395 for ; Mon, 05 Jun 2017 15:03:49 -0400 Received: by mail-ot0-f182.google.com with SMTP id k4so1842044otd.0 for ; Mon, 05 Jun 2017 12:03:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Rx71gp5uwF7su3JJsqOFRZvji5jN5i+st/G9asKbNXM=; b=TMVNyD+Qds9aQ8JTVT7GWZ5UJZBEW1V7XWtF/lSiEs760rH6tgvYBbLGXQ7SqnS/1B WZ6W4UpRonBAWVej2uU9fpAltKBC9/XJiTtAWISu9tCasXRIJpcuptP/IhwlQw4JIfSe O+0gULNq6m4uxfbITaIK/H+7pKzXU3o1OjdOA4RcWWT3ABOYzD1JstEVClMS4rLI83e3 PDJIw4GFwnk8ggKz+CmG7iV0UYZ+slj+9rgE8Z119Jly0VX5EQlY4dAzpdkaxMoG82AS PjDOlfnPCGj4/BNj1kVdrsC8nG3Xl0gUKtE2u9FzaDN3SNEwLIB3C35xSTCGhdqShESb gv0A== 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=Rx71gp5uwF7su3JJsqOFRZvji5jN5i+st/G9asKbNXM=; b=aIax/QLPAICa1chGDAUp9JcDolPjbmx319wxac0/PrTcfmat4/FmFGNRn7ckJ32Z3L UiRPRMS6T3hgTvTUGxfPmlytw0X0ew/vmxbTVwFE10lKYAV8vTfZeAAeb3JCVqG8T1Q0 1U3W4bhibAfYwMqLYbFVEYzuut3iJEyT50adSKbHYNlGhV0S/9qM/FqiODZjf1CaWUOP +5aNDcrtemCx1krNCn72Jt7ztvoBmlAdVYH8KfKdMbOhNvOUnRZwKSQWb1bKk2SxVElN sOT5aqRJgiBxw8wPeszpdMqS3c5xO6Vf8S5kT/QG+n68vV2mYwdLr+krA5SQZjUzVIAY TPdg== X-Gm-Message-State: AODbwcDFXJWwltcQnzpgmfghoDR6Sy5MTuh8FwXIZjwa5GMhMAVpPxog D9iExkfxFsIK5kUqFlr6xt2wgfR20w== X-Received: by 10.157.63.73 with SMTP id m67mr13486923otc.63.1496689426507; Mon, 05 Jun 2017 12:03:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.19.42 with HTTP; Mon, 5 Jun 2017 12:03:45 -0700 (PDT) Received: by 10.157.19.42 with HTTP; Mon, 5 Jun 2017 12:03:45 -0700 (PDT) In-Reply-To: References: <6357d97c-3f2e-4cf8-cb1f-cb7f7ccccf7c@telia.com> <7eaef49b-bf60-9aa1-e812-8430164e3178@garfieldtech.com> <3F920987-38CB-42DD-888D-824430C36F14@gmail.com> <2f9e73c9-444a-11d0-459a-e261ea8a7080@telia.com> <4077c099-2247-c3c1-7dee-02a6b25f8586@fleshgrinder.com> Date: Mon, 5 Jun 2017 13:03:45 -0600 Message-ID: To: Fleshgrinder Cc: internals@lists.php.net, Rasmus Schultz Content-Type: multipart/alternative; boundary="001a114709589b2c1505513b29fe" Subject: Re: [PHP-DEV] [RFC]Discuss] Syntax for Arrow Functions From: derokorian@gmail.com (Ryan Pallas) --001a114709589b2c1505513b29fe Content-Type: text/plain; charset="UTF-8" On Jun 5, 2017 12:53 PM, "Fleshgrinder" wrote: On 6/5/2017 8:36 PM, Rasmus Schultz wrote: > Ugh, you're right, that's totally unreadable... the => is far too ambiguous > with array syntax, I agree. > > How about just a thin arrow? > > (params) -> expr > > If the parens around params were required, it's not ambiguous with the > trailing -- operator, is it? > > $foo->bar(($baz) -> $baz + 1); > > Consistent use of parens around the params might make closures a bit easier > to spot in the wild? > This would actually work with everything, me likes. () -> 42 ($a, $b) -> $a + $b ($a) (&$b) -> $b += $a public static Foo() -> new static('Foo'); However, ($obj) -> $var is valid variable property syntax. It also avoid any association with