Boost logo

Boost :

Subject: Re: [boost] De Bruijn Bind (alternate bind syntax) Interest?
From: Larry Evans (cppljevans_at_[hidden])
Date: 2010-09-03 07:57:01


On 09/03/10 06:33, Stefan Strasser wrote:
[snip]
>> auto flip =
>> lam<1>(lam<2>(app(_2_1(), _1_2(), _1_1())));
>
> or:
>
> auto flip=lam(lam(app(_2_1,_1,_2)));
>
> david, why do you need to number the lambdas? doesn't the "nested index"
> of the args refer to the level of nesting instead of the number given to
> the lam<> template?
In:

  lam<I>

I is arity, not nesting, of the lambda expression:

  http://bitbucket.org/camior/de-bruijn-bind/src#cl-45

IOW:

    \(x1,x2,x3).x1+x2+x3
=>
    lam<3>(arg<0,1>+arg<0,2>+arg<0,3>)

[snip]


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