Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88678 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43532 invoked from network); 5 Oct 2015 11:06:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Oct 2015 11:06:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.180 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.180 mail-wi0-f180.google.com Received: from [209.85.212.180] ([209.85.212.180:33442] helo=mail-wi0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FF/30-40211-1C952165 for ; Mon, 05 Oct 2015 07:06:42 -0400 Received: by wiclk2 with SMTP id lk2so114636053wic.0 for ; Mon, 05 Oct 2015 04:06:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type; bh=d4mhacqHUXxd+xxq/LQz3kXTTV/gH71AL+5nm4vIGJY=; b=bCC+PF6JYege+NIxe3LBY953woVi4xEiG2HdVuG/KvWMO+W0pascn7KCYKWEMtYjT3 wtlgUWf6nTh4hDlNN/tcgt5BRCZ+pqWJfSDKZxK9zYiIbCesFjC7oAgp6QFaCbqTRY+D m9/NOIi+7TJwjsagEUQjSx7HFLlLKfev34y7qOpIlqnC/cVQi+gW1bPvKs3tWZX/M8ru XAuMf266WzEq69aVcPbzw2XIqXCe/t2mKwWfJ3EOa7plh6J2sQhgD+Wg2XNbJxijtB+B K4QV3l85cl0SSSI9PAS7gCWDJ6MbX/hjDE+EOSdtGTQOqYEPie9vINCV2y6IogJHwnd1 kiRg== X-Received: by 10.180.103.35 with SMTP id ft3mr11694085wib.60.1444043198692; Mon, 05 Oct 2015 04:06:38 -0700 (PDT) Received: from [192.168.0.126] ([62.189.198.114]) by smtp.googlemail.com with ESMTPSA id fu5sm17467634wic.0.2015.10.05.04.06.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Oct 2015 04:06:37 -0700 (PDT) To: internals@lists.php.net References: <56103B9F.7080508@thefsb.org> Message-ID: <561259A3.9080908@gmail.com> Date: Mon, 5 Oct 2015 12:06:11 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <56103B9F.7080508@thefsb.org> Content-Type: multipart/alternative; boundary="------------080904000806080903000203" Subject: Re: [PHP-DEV] Re: [RFC] Arrow Functions From: rowan.collins@gmail.com (Rowan Collins) --------------080904000806080903000203 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Tom Worster wrote on 03/10/2015 21:33: > when the grammar starts with function(args), it seems the main > difference from existing grammar is to make the curly braces when > there's only one statement in the function block. > > in other contexts i had the impression that things like > > if (bool-expr) statement; > > and similar were going out of fashion fast. Yeah, I'm not sure I agree with this line in the RFC at all: > It also avoids the use of |{}| which means that writing closures in-line is less painful. Avoiding the *return* statement I'm right behind, but if the => is no longer acting like an operator (which with the function keyword in place, it's really not), some extra brackets around the expression seem like they'd improve readability. What about moving the => into the function(...) block? function($foo) => $x * $y vs function($foo => $x * $y) --------------080904000806080903000203--