Boost logo

Boost :

Subject: Re: [boost] painless currying
From: Dave Abrahams (dave_at_[hidden])
Date: 2011-09-05 15:12:17


on Mon Sep 05 2011, Thomas Heller <thom.heller-AT-googlemail.com> wrote:

> On Mon, Sep 5, 2011 at 1:28 PM, Daniel James <dnljms_at_[hidden]> wrote:
>> On 5 September 2011 12:10, Maxim Yanchenko
>
>>>
>>> I'm on Dave's side here: we should be explicit about the time when we want to
>>> trigger actual evaluation.
>>
>> The problem is that existing generic algorithms won't trigger
>> evaluation, so currying couldn't be used with, say, std::transform.
>> That's why I would make partial application explicit, with a normal
>> function call causing evaluation. But I think that was considered too
>> verbose.
>
> Actually, that is not the case. If you take phoenix, bind or lambda,
> and call the resulting functor with not enough arguments it will give
> you a pretty ugly error. And this is what the currying is about
> ... return another functional if the supplied arguments aren't enough
> to evaluate the lazy function object. What you mean is you supply too
> much arguments. Which won't be affected.

I don't think you're understanding what he means at all.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk