Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88608 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23560 invoked from network); 1 Oct 2015 15:52:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Oct 2015 15:52:13 -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.213.46 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.213.46 mail-vk0-f46.google.com Received: from [209.85.213.46] ([209.85.213.46:34539] helo=mail-vk0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A1/C8-04700-CA65D065 for ; Thu, 01 Oct 2015 11:52:12 -0400 Received: by vkat63 with SMTP id t63so42807883vka.1 for ; Thu, 01 Oct 2015 08:52:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=9RjwDd3MzuDBzXTQ7mlHXRguiPFGtk6wwNEtqcAzrTA=; b=G3fTlm6OtL6d1dQd3exuBBtlRX9S5QB140xTatKAW3B1BZM27BqSZNTGuXrr6fuKbw QiIdnClYeXjyMSzcj9mNTbIScK/PZ/q8pOC+RLYUFQAmAujMqziLs4H8MCO75NX9mNV5 x3H18WbKDdsnxYxxyXz1+h9wcqEWLDFrJWdtbq2kXxAAdSfWO1wd0qPClxTK2kT1r7N0 3wTvSrhHXzsajd9dSPHkQ9qh9y+ZE3RJOMEo8X8LE1TEWSW+TVgD78EgP2r0DG/5L0uT jVoICIFZIU7fmjTHZqQCsAO5Ix//lloVMvy9GJaBS/1+A924/7m2/RiEtfTM0vm5RRk5 rpdg== MIME-Version: 1.0 X-Received: by 10.31.174.133 with SMTP id x127mr6835111vke.26.1443714729893; Thu, 01 Oct 2015 08:52:09 -0700 (PDT) Sender: morrison.levi@gmail.com Received: by 10.31.41.205 with HTTP; Thu, 1 Oct 2015 08:52:09 -0700 (PDT) In-Reply-To: References: <5606D0EB.3060106@gmail.com> <560D0F94.8060009@gmail.com> <560D282F.6060202@gmail.com> Date: Thu, 1 Oct 2015 09:52:09 -0600 X-Google-Sender-Auth: d-MEwAoMU8QWFkZ6g8519iEFET4 Message-ID: To: Ryan Pallas Cc: Nikita Nefedov , "internals@lists.php.net" , "rowan.collins@gmail.com" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Arrow function expressions in PHP From: levim@php.net (Levi Morrison) >> And one thing that makes auto capture much better choice than explicit >> capture (as it've been said a couple of times already) is partial >> application: >> >> $mul = fn($x) => fn($y) => fn($z) => $x * $y * $z; >> >> Looks simpler than: >> >> $mul = fn($x) => fn($y; $x) => fn($z; $x, $y) => $x * $y * $z; >> >> > Yes it looks simpler, but if this is going to continue being the argument > for auto-capturing can we at least get a real world example? I have never > once in the wild seen a lambda that returns a lambda that returns a lambda, > all using variables from the previous lamba(s). I'm fairly certain no one > will invoke the overhead of a function call 3 times just to multiply 3 > numbers together. Please give me a valid example if you want me to believe > this to be a valid argument. This is close: https://github.com/morrisonlevi/Algorithm/blob/master/src/reduce.php