Subject: Re: phoenix lambda-lambda for_each example
From: David Abrahams <[email-masked]>
To: Joel de Guzman <[email-masked]>
Cc: Noah Stein <[email-masked]>, Aleksey Gurtovoy <[email-masked]>, Jaakko Jarvi <[email-masked]>
Date: Thu, 04 Mar 2004 11:49:42 -0500

Joel de Guzman <[email-masked]> writes:

> Now, I am carrying on with that belief. The tide has turned and
> I see now that FC++'s look and feel as alien and so detached from
> the C++ syntax. I believe that one reason for MPL's success is it's
> instant familiarity. As much as posible, I would like to use
> a syntax that would give the user an almost instant "aha!".
>
> So, here's a refinement to my proposal:
>
> * All arguments on parameter slots expecting a function object
> will be interpreted as scoped lambdas. (implicit scoping)
>
> * Let the usual _1 ... _10 place holders retain its current
> meaning. It's scope will always be the outermost scope of a
> lambda expression.
>
> * Introduce a new set of placeholders _a ... _j. The scope of
> these place-holders will be the innermost lambda where it
> is found.
>
> Here again is our sample. I want to push_back argument _2 to all
> sequences in argument _1:
>
>      for_each(_a, push_back(_a, _2))
>
> Notice that the leftmost _a can be replaced by _1 but
> the second _a cannot.
>
> I believe this is the best syntax so far. 

Wow.  Makes my head spin.

> With this scheme, there might be no need for "outer" anymore. 

That was far more intuitive to me.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com