Boost logo

Boost :

Subject: Re: [boost] phoenix::bind
From: Joel de Guzman (joel_at_[hidden])
Date: 2008-10-02 10:32:45


Peter Dimov wrote:
> Joel de Guzman:
>
>> Oh my, there's a lot of discussion I can't find that snippet
>> of information. Anyway, it has something to do about using
>> the "let" semantics be applied to "lambda" only on the
>> top level. I think it will work with the lambda syntax and
>> behavior you sought for.
>
> Not quite.
>
> The purpose of unlambda is to allow you to pass a lambda expression into
> a function that expects an ordinary function object and might use it as
> a part of another lambda expression.
>
> template<class F> void g( F f )
> {
> h( bind( f, _2, _1 ) );
> }
>
> int main()
> {
> g( _1 < _2 ); // fail
> g( unlambda( _1 < _2 ) ); // works
> }
>
> A top-level lambda[] that does let()[] will not work for this case.

Yep, I'm keeping the behavior of protect, not unlambda. As
I mentioned in my other post. val(_1 < _2) can probably be
the unlambda behavior.

BTW, has anyone realized that if I were to make phoenix, lambda,
then lambda[ ... ] will be ambiguous with the namespace lambda?
Argh!

Regards,

-- 
Joel de Guzman
http://www.boostpro.com
http://spirit.sf.net

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