Boost logo

Proto :

Subject: Re: [proto] proto-11 progress report
From: Bart Janssens (bart.janssens_at_[hidden])
Date: 2012-06-25 15:44:53


On Sun, Jun 24, 2012 at 1:10 AM, Eric Niebler <eric_at_[hidden]> wrote:
> A custom transform is simply a struct that inherits from
> proto::transform and that has an operator() that accepts an arbitrary
> number of parameters.

Aha, nice! We are using the current proto to enable "custom terminals"
that also take any number of parameters through operator(), and then
pass on the evaluation to a user-defined struct. Looks like this
mechanism may simplify the implementation.

> Data parameter uses a slot mechanism
> ====================================
> In proto today, transforms take 3 parameters: expression, state and
> data. As you can see from above, transforms in proto-11 take an
> arbitrary number of parameters. However, that can make it hard to find
> the piece of data you're looking for. Which position will it be in?
> Instead, by convention most transforms will still only deal with the
> usual 3 parameters. However, the data parameter is like a fusion::map:
> it will have slots that you can access in O(1) by tag.

Intersting! Our current "data" element contains a fusion vector, also
to enable grouping of strongly typed data. This is a major source of
complexity in our code, so it will be simpler if we can reuse this
mechanism.

So as far as I'm concerned, you hit the nail right on the head with
these features ;)

Cheers,

-- 
Bart

Proto list run by eric at boostpro.com