Subject: Re: [boost] painless currying
From: Jeffrey Lee Hellrung, Jr. (jeffrey.hellrung_at_[hidden])
Date: 2011-09-05 11:42:06
On Mon, Sep 5, 2011 at 4:28 AM, 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
If you want to be explicit, why not curryN then?
curry3(f)(x)(y) -> not yet evaluated...
curry3(f)(x)(y)(z) -> evaluated
There is still Dave's symmetry problem, but at least the evaluation behavior
curry3(f)(x,y)(z) == curry3(f)(x)(y)(z)
and the like.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk