Boost logo

Boost :

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


On 09/03/10 12:09, Dave Abrahams wrote:
> Can someone explain to me, in English, what this technique allows me
> to express that I couldn't otherwise?
>
> Is this just about allowing generic composition of lambdas?
>
Nothing, AFAICT. What it does do is make implementation
of beta reduction easier to implement because one doesn't
have to do any alpha conversions. I think one has to do
some decrementing of the NestLevel in the
arg<NestLevel,ArgIndex> terms, as suggested by:

 2. decrease the free variables of M to match the removal
    of the outer λ-binder

From:

  http://en.wikipedia.org/wiki/De_Bruijn_index

Now I'm guessing here David, but when I've encountered
problems with mpl's apply<F,A1,A2,...,An>,
sometimes I've had to wrap F in an mpl::lambda to get
it to work

Now one thing that this DeBruijn technique *might* do, is simplify
that lambda, because mpl::lambda looks real complicated
to me. Maybe Mr. Sankel could give that a try, although
his code only deals with values and not types.

For those unfamiliar with the beta and alpha terms, this may help:

  http://en.wikipedia.org/wiki/%CE%91_conversion#.CE.B1-conversion


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