Boost logo

Boost :

Subject: Re: [boost] phoenix::bind
From: Eric Niebler (eric_at_[hidden])
Date: 2008-09-29 11:50:16

Peter Dimov wrote:
> Joel de Guzman:
>> Peter Dimov wrote:
> ...
>>> Is it a goal of phoenix::bind to one day replace lambda::bind and
>>> boost::bind, being a superset of both, as well of std::bind?
>> lambda::bind, yes. std::bind cannot be replaced. boost::bind, too,
>> IMO cannot be replaced, not in a long time, due to, as you said
>> below, it works on more compilers.
> It can be replaced on the compilers on which Phoenix works. It can also
> conform to the specification of std::bind, allowing people to move code
> back and forth.

This should be possible, and I agree it would be a Good Thing.

>> I supported the lambda tests in phoenix.
> This is very reassuring. Have you considered making a "reimplementation"
> of Lambda's headers part of the reviewed library? Might this be a
> feature that would convince people that it is not necessary to wait for
> V3 in order to "accept" Phoenix? Lambda's interface is stable and moving
> from V2 to V3 will not affect its users.

I have re-implemented both lambda and phoenix on top of proto, and IMO I
don't believe phoenix should provide a 100% backwards-compatible lambda
interface. Lambda has some quirks that it would be best to leave behind.
Lambda and phoenix differ as to whether local variables are captured by
value or by reference (phoenix always captures by value, lambda tries to
guess what you intend based on usage). This is a fundamental difference
-- difficult to reconcile.

I support Joel's approach of deprecating the old lambda interface and
migrating folks to phoenix.

Eric Niebler
BoostPro Computing

Boost list run by bdawes at, gregod at, cpdaniel at, john at