Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-03-19 11:14:54


From: "Gary Powell" <Gary.Powell_at_[hidden]>

> > Which reminds me... What is the status of the lambda library, that is,
how
> > close is it to boost release?
> Ok Lambda:
> We've split it into 3 libraries:
> tuples
> bind
> lambda
>
> The tuples is nearly ready for a boost release. Maybe another week or so.
> (Some documentation, and a better test suite)
> The bind and lambda stuff has been "boostified" but not as much effort has
> been put into it to make it as portable. They really need partial
> specialization. (And the docs are much less comprehensive, as is the test
> suite) So judging from the comments we get on tuples, we thought we could
> apply that effort to next, bind and then lambda. So the answer is we are
> close, and the at our day job work has been the impediment to progress.

I've been thinking about splitting my expression.hpp into bind.hpp and
expression.hpp as well. Let me outline some of the ideas I've been toying
with:

bind(f); // gives a library-compatible function object

bind(&Class::member); // ditto, works with Class &, Class *,
shared_ptr<Class>, variant<Class>, etc as a first argument.

bind(f, _2, _1); // lambda(x, y, ...) := f(y, x);

bind(f, 4, _, 5); // lambda(x, y, ...) := f(4, x, 5);

bind(_, 1, 2); // labmda(x, ...) := x(1, 2);

> > Should I continue my work on a more portable
> > alternative or this will turn out to be a wasted effort?
> If you have an alternative which doesn't require partial specialization
that
> runs on MSVC, it will be very much appreciated by those of us stuck with
> this dang compiler. I've had it, and have stopped trying. Although I know
> that is a bad attitude. And judging from the comments by the folks in
> Redmond reading this list I am hopeful that they are working on it.

Very difficult. I can't do the general case without typeof, or remove_cv and
remove_reference (I've tried several times.) bind.hpp, however, is doable
(in theory.)

I think that we should propose a common interface, to give people a chance
to implement it for the platform they are interested in. The full-featured
Lambda library will eventually subsume the various implementations, but in
the meantime, there'll be something to play with.

--
Peter Dimov
Multi Media Ltd.

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