Boost logo

Boost :

Subject: Re: [boost] phoenix::bind
From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-10-01 12:32:00


Joel de Guzman:

> Maybe you want:
>
> let(_a = 0)[ ++_a ]

Maybe I do. :-)

> phx::for_each(_1, lambda[std::cout << _1 << std::endl])
>
> Notice that like protect, there are two function invocations happening
> here.

The confusion here comes from the fact that the above would work if lambda[]
had "unlambda" semantics, that is, if it returned a function object that was
not a phoenix expression.

> - \ \
> double - /\ f . /\ x. f(f x)
> - / \ / \

lambda( _f = _1 )[ bind( _f, bind( _f, _1 ) ) ] ?


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