Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98201 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36281 invoked from network); 4 Feb 2017 21:30:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Feb 2017 21:30:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.51 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.215.51 mail-lf0-f51.google.com Received: from [209.85.215.51] ([209.85.215.51:33781] helo=mail-lf0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 01/FA-38491-6F746985 for ; Sat, 04 Feb 2017 16:30:31 -0500 Received: by mail-lf0-f51.google.com with SMTP id x1so26891095lff.0 for ; Sat, 04 Feb 2017 13:30:30 -0800 (PST) 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=pJxblHHcnvM+R4r0oo80UbpZHl9D9UQvhltbVb2fbCI=; b=PmdC+LC2ejYdHSeHqExRR005pQ0rb3dQbZboacYl2tzq2IlQSQhaedtQ4OKbBvAywS zbRoj5F9OSOu8iB01jCAbS/Bk3PkDNVEyLAEGaDGk9fGCATC7MAxPowekRQTnbJ1LVjx KNwL1oqvjIGNwUP5bk08q+Ch5vL7LJu2UmiXr9yTwWDEdsfTTK+iGrf5SGsSfkaGJAyq 4/g4QFm0kmjBJ277nhkN9JJDhbCO7m7SaMAR1qLJ9Aj7T2jacdShaQcuK3iiKuRVEgZs xm6y44fr7pzvrOXP2LBbwA+c7QoZjP/T4uCZYntgyld9RLa08LNcrr1RMHBJBtj+wofn nMog== 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=pJxblHHcnvM+R4r0oo80UbpZHl9D9UQvhltbVb2fbCI=; b=dlpkBEVYMFeCY4tmjCE9iePXcYARTunTvBf9Ey+dNttZJtd4j2j5Z71GPAJtM424Vl bZttPy+drCnKgzkTGDZ6LgYogYRzEhu/pQxKU0RSvp5VINVicsqgORIqCvuobks1wcw2 GziYt8ZXASMpkTY3U+yVu/6fFPWtIvfChq7+53vHrTY/Xmj6zw4Hs6ILWGT/X3ovxAWX qVpC/wMGjwsdCFeVjjyAbU3H857QSdeJcME1wZ65WyWhXctMy8aRQaK8DJdFlbLy+VOu bwZMy3sfRGhxwOHQGz7XGvQART0iQvtkG6v7xjTzu9keZ0zzpV+5gUKqpI1RwzUINFdu vBkA== X-Gm-Message-State: AMke39n9Cv3qVEuiwLHz19FfPE/ZgYBKm+k0S5F+lXfQWIzZWLjSa3Aqz0XF7bbaZparv4o4gB0PzhflWmApDQ== X-Received: by 10.46.71.132 with SMTP id u126mr1247063lja.43.1486243827280; Sat, 04 Feb 2017 13:30:27 -0800 (PST) MIME-Version: 1.0 Sender: morrison.levi@gmail.com Received: by 10.25.151.139 with HTTP; Sat, 4 Feb 2017 13:30:26 -0800 (PST) In-Reply-To: References: Date: Sat, 4 Feb 2017 14:30:26 -0700 X-Google-Sender-Auth: rnieuhCW9cjdNlFToEUFOaj1in4 Message-ID: To: Larry Garfield Cc: internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Re: [RFC][Discuss] Arrow Functions From: levim@php.net (Levi Morrison) > And then there's the extra typing and visual space taken up, which is not > something to dismiss entirely. Also, as someone else mentioned this syntax > *seems* like it would support nesting. Compare the following: > > $x = function($a) => function($b) => function($c) => $a * $b * $c; > $y = fn($a) => fn($b) => fn($c) => $a * $b * $c; > $z = |$a| => |$b| => |$c| => $a * $b * $c; > > print $x(1)(2)(3); // prints 6 > > Which of these is more readable? Id' argue it's not $x. In a past version the RFC included an example of chaining. The current version doesn't show an example, but does say it is possible. To be clear: $x = fn($a) => fn($b) => fn($c) => $a * $b * $c; Is supported in the current implementation. It would similarly be supported in the `|params| => expr` notation.