Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:99296 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 40320 invoked from network); 31 May 2017 13:48:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 May 2017 13:48:08 -0000 Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.170 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.223.170 mail-io0-f170.google.com Received: from [209.85.223.170] ([209.85.223.170:33273] helo=mail-io0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/BC-43873-699CE295 for ; Wed, 31 May 2017 09:48:07 -0400 Received: by mail-io0-f170.google.com with SMTP id p24so16295266ioi.0 for ; Wed, 31 May 2017 06:48:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=2H4iebxJtyuXz/BI9ei0g8Wg4/xqKwMOnXsSLVZgO9s=; b=H5aw4xxs1M+jVcjA8IMtAtYxMhMEq4wVoEw9wkGszxqC5+4XhXMulpsHLvzk6gaDfg J75A2OD56jdQV+L9UByUFlZY+vl5hIFuSZdIGurYtOk8L6c4CQ9HEPLA7oD1K9xtAKmQ vVIyRolteBphnGHNNVCp01npYh8ERGl6TVK1YlehSbFXKxKhJSGKkaNBhb5TuijgCEb3 WlLsZPWp2jZBruQSO/jSmLllNMJYITQsc3ug4vTAVh41oAsMgeBScMf8IzDfsBJDeFFk 5438BiW/2oLQuaj0jYaSkbvfI0FaC1PAut7iHh4yK6phQ7SWRlAYEh5QKdBsdM23YLzf ttVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=2H4iebxJtyuXz/BI9ei0g8Wg4/xqKwMOnXsSLVZgO9s=; b=PFKkAopraBRof0+Choh3gTVOZNyXDLOBilWpPT4y6jfr0NGr7Q9pIiGkZ+dDU82oXN 8JIGIksWy7U3mEHvBGXuzcRoXjagI9y+pqRlSBnicODYKwcWv1+8ozy8vFaIE/lQ/iL/ ASQ+eqKHB6Vnq5hRjv34LF+P/aVDOHDpSxIwLaAsGVO5so6t5QMgEacXQ4UFg1V7vJL9 pIp0CQWXcLv2iK1LJdPm5bYk6Iv55q/Bs6Q+dSMUTcyUEWB2Epx+ij4KHtPmkbOhCCsg Qxhu9EsqrVxi7Jh0nsIxN3q6g6GDQ3xfzv2+NI6TqkVr2n44yUwKtr+Em6UghxQCqOgX 5v6Q== X-Gm-Message-State: AODbwcBDwZhXG+JvzOmnMuoC1by7aytXcsSaiC/01AHDVa/Oczyy4Whr WniKtSMAAwKbEOD32dkD3f3noy1TBA== X-Received: by 10.107.151.79 with SMTP id z76mr22944633iod.98.1496238484175; Wed, 31 May 2017 06:48:04 -0700 (PDT) MIME-Version: 1.0 Sender: morrison.levi@gmail.com Received: by 10.107.12.159 with HTTP; Wed, 31 May 2017 06:48:03 -0700 (PDT) In-Reply-To: <934DD9E3-FACE-4BE0-A40F-0B240FE5D186@gmail.com> References: <934DD9E3-FACE-4BE0-A40F-0B240FE5D186@gmail.com> Date: Wed, 31 May 2017 07:48:03 -0600 X-Google-Sender-Auth: y6he7MH3g-2xW2ckWU-kNEf3DyQ Message-ID: To: Rowan Collins Cc: internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC]Discuss] Syntax for Arrow Functions From: levim@php.net (Levi Morrison) On Wed, May 31, 2017 at 7:36 AM, Rowan Collins wrote: > On 30 May 2017 18:58:14 BST, Levi Morrison wrote: >>Internals, >> >>The previous discussion thread has died down significantly and so I'd >>like to start a new one to refocus. This message has some redundant >>information by design so people don't have to reference the other >>thread so much. >> >>Based on the discussion there are a few different syntax choices >>people liked. Overall it's a feature that people seem to want but >>everyone seems to prefer a different syntax choice. > > I was just pondering alternative approaches to stop the => token being ambiguous, and wondered if surrounding the whole expression with braces could work: > > { => $bound * 2 } > { $a, $b => $a * $b } > > I believe this eliminates the ambiguity with array notation, and is more concise than pretty much every alternative. I'm my opinion, grouping the arguments and body would make it more readable in context, as well. This does not work. We permit expressions as statements and we also allow empty blocks: { $a = $foo; } These will conflict in the grammar.