Boost logo

Boost :

Subject: Re: [boost] Template metaprogramming libraries
From: Ábel Sinkovics (abel_at_[hidden])
Date: 2011-09-11 03:01:11


Hi Larry,

> Are you saying that using the existing mpl, one cannot embed
> lambda expressions inside other lambda expressions? Is that
> mpl problem an example of name capture:
>
> http://dictionary.reference.com/browse/name+capture
>
> ?

You can embed MPL lambda expressions inside other ones. I couldn't find
a way of accessing the arguments of the outer lambda expression from the
inner one, because the names _1, _2, etc were referring to the arguments
of the inner expression, not the outer one (they were shadowing the
outer ones).

I'd express it with "\x.\x.x" in lambda calculus. Inside the inner
lambda abstraction "x" refers to the argument of the inner, not the
outer one.

Regards,
  Abel


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