Subject: Re: [boost] De Bruijn Bind (alternate bind syntax) Interest?
From: OvermindDL1 (overminddl1_at_[hidden])
Date: 2010-09-03 18:17:28
On Fri, Sep 3, 2010 at 3:42 PM, Dave Abrahams <dave_at_[hidden]> wrote:
> On Fri, Sep 3, 2010 at 5:22 PM, David Sankel <camior_at_[hidden]> wrote:
>> On Fri, Sep 3, 2010 at 4:46 PM, Dave Abrahams <dave_at_[hidden]> wrote:
>>> On Fri, Sep 3, 2010 at 2:52 PM, Larry Evans <cppljevans_at_[hidden]>
>>> wrote:> Since, as I mentioned, I had trouble understanding how apply
>>> > worked, and the code seems pretty complicated, at least to me,
>>> > I was hoping DeBruijn's method would offer simplifications.
>>> >From the examples I've seen so far, this would make it easier for bind
>>> library writers at the expense of usability. Â On th other hand, once
>>> lambdas start to use protect() I'm usually giving up on them ;-)
>> Usability is hurt from whose perspective? The bind author or the bind user?
> The bind user
>> And how so?
> 1. It means learning a totally new paradigm for writing ordinary
> lambdas thatâso farâseems to require the grasp of quite a few concepts
> that are not familiar to the average C++ programmer. Â bind and its
> cousins may not be as flexible, but they're designed to be intuitively
> graspable (to a C++ programmer), and the paradigm is now going into
> the standard so will be lingua franca.
> 2. Again, please correct me if I'm wrong about this, but it looks like
> for "ordinary lambdas" (those that don't need protect), the
> corresponding bind expressions are always shorter and simpler.
Again, if built on Boost.Phoenix, could it not be just like this as
using namespace boost::phoenix;
bind(f, _1, 314)(42);
bind(f, bind(g, _2_1), _1_1)(42);
And whatever else...
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk