Boost logo

Proto :

Subject: Re: [proto] fold_tree and grammar using external_transforms and state
From: Eric Niebler (eric_at_[hidden])
Date: 2012-07-27 13:07:25

On 7/27/2012 12:19 AM, Joel Falcou wrote:
> Le 27/07/2012 08:11, Eric Niebler a écrit :
>> Naming is becoming an issue, though. We already have proto::transform.
>> You'd be adding proto::functional::transform that would be totally
>> unrelated. I think I screwed up with the namespaces. It should probably
>> be proto::functional::fusion::transform. Urg.
> Well, I guess this is a breaking change :s

I could import the existing stuff into proto::functional for back-compat.

> What I need is maybe more generic as I need to apply an arbitrary
> function with arbitrary number of parmaeters, the first beign the
> flattened tree, the others begin whatever:
> transform( f, [a b c d], stuff, thingy )
> => [f(a,stuff,thingy) f(b,stuff,thingy) f(c,stuff,thingy)]

Seems to me you want to be able to bind the 2nd and 3rd arguments to f
so that you can do this with a standard transform.

   transform( [a b c], bind(f, _1, stuff, thingy) )

=> [f(a,stuff,thingy) f(b,stuff,thingy) f(c,stuff,thingy)]

> I'll try and ake it works out of the box first and see how it can be
> generalized.

I'll take transform and bind if you write them. :-)

Eric Niebler
BoostPro Computing

Proto list run by eric at