Boost logo

Boost :

Subject: Re: [boost] painless currying
From: Thomas Heller (thom.heller_at_[hidden])
Date: 2011-08-26 13:46:35


On Fri, Aug 26, 2011 at 7:31 PM, Eric Niebler <eric_at_[hidden]> wrote:
> On 8/26/2011 1:10 PM, Dave Abrahams wrote:
>> on Thu Aug 25 2011, Eric Niebler <eric-AT-boostpro.com> wrote:
>>> On 8/25/2011 4:16 PM, Dave Abrahams wrote:
>>>> on Thu Aug 25 2011, Eric Niebler <eric-AT-boostpro.com> wrote:
<snip>
> Eric Niebler wrote:
>> I don't see any technical obstacles to:
>>
>> f(_, y, z)
>>
>> where _ is a placeholder. You could use positional placeholders for
>> argument reordering.
> You might say the syntactic advantages of this over bind(f, _, y, z) are
> minimal. You might be right.

Exactly my thinking. I additionally have some problems in thinking
about possible semantics:

auto g = f(_, y, z); // pretend that f is a curryable function
auto h = g(1); // same as f(1, y, z)? what if f had a 4th argument?

As much as i like the idea, i can almost always construct trivial
usecases where the
proposed syntax is ambiguous.


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