Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88611 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29962 invoked from network); 1 Oct 2015 16:47:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Oct 2015 16:47:21 -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.175 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.175 mail-wi0-f175.google.com Received: from [209.85.212.175] ([209.85.212.175:33394] helo=mail-wi0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5D/B0-26330-8936D065 for ; Thu, 01 Oct 2015 12:47:20 -0400 Received: by wiclk2 with SMTP id lk2so42631141wic.0 for ; Thu, 01 Oct 2015 09:47:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:references:to:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=/x+B8u7VSycRoqmQnL0Ck/mRnSaSzSnntTHZ9SMllT8=; b=Ly2sBLMzed/Grtss82v252HbS3pYmwqnDRueZox7KWEvRFIw4Wphz9UzCy4DUud8wt 9SnOAOfsAh0CHcIjUg1GbKeA/5XwHOPJGNaYwF7hXjcjYjRM5xRFiOtuzf6qiKthY68b MaZwCQCMCyTE0KGpdhvhh9M9tvj392YOVoOJrO6jVk5wAUn94G1OotmH+pf8VZvA2oal PG6A3E8zccbjw+R5T0a6dSLdDdE/mF3vrKxwEepS8U64Lg+K6uebp8iCM15Yu4XICzty HEdhL9eRS78NY06SkQwZtITLY68jM1Ptg5s3H81tzf1k718whd2Hi2hbY+g9eiYazZ49 m+yg== X-Received: by 10.194.134.197 with SMTP id pm5mr5720858wjb.118.1443718036820; Thu, 01 Oct 2015 09:47:16 -0700 (PDT) Received: from [192.168.0.161] ([62.189.198.114]) by smtp.googlemail.com with ESMTPSA id ld5sm7008206wjc.18.2015.10.01.09.47.16 for (version=TLSv1/SSLv3 cipher=OTHER); Thu, 01 Oct 2015 09:47:16 -0700 (PDT) References: <5606D0EB.3060106@gmail.com> <560D0F94.8060009@gmail.com> <560D282F.6060202@gmail.com> To: "internals@lists.php.net" Message-ID: <560D638E.5020706@gmail.com> Date: Thu, 1 Oct 2015 17:47:10 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Arrow function expressions in PHP From: rowan.collins@gmail.com (Rowan Collins) Levi Morrison wrote on 01/10/2015 16:52: > This is close:https://github.com/morrisonlevi/Algorithm/blob/master/src/reduce.php When would you store or pass around the intermediate callback (the result of reduce($initial)) without immediately invoking it with a callback? If you just run "reduce($initial)($my_fn)($data)", it seems no more useful than "reduce(42, $my_fn, $data)", which would be more efficient internally. If anything, I can imagine wanting to write $my_reduce = reduce($my_fn) and then $my_reduce($initial, $data), but that's still 2 steps rather than 3. Genuine question, not a criticism - this functional(?) style of composition is not something I'm very familiar with. (For the same reason, I struggle to read that function definition no matter which syntax it's expressed in.) Regards, -- Rowan Collins [IMSoP]