Subject: Re: [Boost-users] [lambda] extending lambda functions
From: alfC (alfredo.correa_at_[hidden])
Date: 2009-03-22 03:26:33


Hi Joel,

On Mar 21, 9:49 pm, Joel de Guzman <j..._at_[hidden]> wrote:
> alfC wrote:
> > the question is what do I have to do to be able to use the following
> > syntax instead
> >                  _1 + llnorm(_2)
>
> Lambda does not have such a facility.

Ok, I believe you, I will use bind instead for the moment.
 However I am still puzzled: for example, when boost::lambda
defines some operator+ (the one use above) it does indeed what
we expect. What is special about operator+ compared to any other
user defined (lazy) function defined by the user?
(i.e. the lazy function that I want but don't know how to define in
the context of Lambda)
After all the operator+ above must be a function defined somewhere.

> You can use Phoenix instead.
> Phoenix (lazy) functions allow you to do that. Phoenix is intended
> to supercede Lambda. Phoenix has been reviewed and is conditionally
> accepted into Boost after another mini-review.

I used Spirit a little bit and I recall that Phoenix was part of
Spirit or something like that.
While we wait for the Phoenix library, would you recommend to use the
Phoenix included in Spirit?

Thanks,
Alfredo