
On Thu, Sep 25, 2008 at 2:54 PM, Giovanni Piero Deretta <gpderetta@gmail.com> wrote:
On Wed, Sep 24, 2008 at 10:00 PM, Doug Gregor <dgregor@osl.iu.edu> wrote: <snip>
Is "lambda" equivalent to BLL's "unlambda" or "protect"?
as far as I can tell no, because boost::lambda::protect(f) is basically the identity, except that it changes the type of 'f', hiding its 'lambdiness'.
OTOH phoenix::lambda[f] returns a stub that in turns returns 'f' (I didn't check if the type of 'f' is changed). The phoenix machinery makes sure that when used as a nested lambda expression, lambda[] actually work more or less like protect. The abstraction break if you use lambda[] as top level.
For more on this topic, see my comments about phoenix on another mail.
Sorry for the confusion, I keep confusing protect and unlambda. I still find the need of adding another evaluation round to the result of lambda surprising. -- gpd