Re: [proto] proto-11 progress report

2012-07-20 Thread Eric Niebler
On 7/17/2012 6:14 PM, Eric Niebler wrote: > I'm considering adding the slots mechanism to proto-current so that this > can be made to work there, also. The problem is that once you use a > slot, the data parameter is no longer just a dumb blob. I can make > proto::_data ignore the slots and just re

Re: [proto] proto-11 progress report

2012-07-17 Thread Eric Niebler
On 6/25/2012 12:21 PM, Mathias Gaunard wrote: > There is a function which is very simple and that I found to be very > useful when dealing with expression trees. > > unpack(e, f0, f1) which calls > f0(f1(e.child0), f1(e.child1), ..., f1(e.childN)) > > I can do recursion or not with the right f1,

Re: [proto] proto-11 progress report

2012-07-01 Thread Eric Niebler
On 6/29/2012 4:49 AM, Mathias Gaunard wrote: > On 28/06/2012 21:09, Eric Niebler wrote: > >> After meditating on this for a bit, a thought occurred to me. Your >> unpack function is a generalization of the pattern used by the _default >> transform. > > It is indeed. Right. Providing the higher-l

Re: [proto] proto-11 progress report

2012-06-29 Thread Mathias Gaunard
On 28/06/2012 21:09, Eric Niebler wrote: After meditating on this for a bit, a thought occurred to me. Your unpack function is a generalization of the pattern used by the _default transform. It is indeed. Generators are intended to meet this need. What are they lacking for you? Is it the la

Re: [proto] proto-11 progress report

2012-06-28 Thread Eric Niebler
On 6/27/2012 2:11 PM, Mathias Gaunard wrote: > On 25/06/2012 23:30, Eric Niebler wrote: >> On 6/25/2012 12:21 PM, Mathias Gaunard wrote: > >>> There is a function which is very simple and that I found to be very >>> useful when dealing with expression trees. >>> >>> unpack(e, f0, f1) which calls >

Re: [proto] proto-11 progress report

2012-06-27 Thread Mathias Gaunard
On 25/06/2012 23:30, Eric Niebler wrote: On 6/25/2012 12:21 PM, Mathias Gaunard wrote: There is a function which is very simple and that I found to be very useful when dealing with expression trees. unpack(e, f0, f1) which calls f0(f1(e.child0), f1(e.child1), ..., f1(e.childN)) I can do recu

Re: [proto] proto-11 progress report

2012-06-25 Thread Eric Niebler
On 6/25/2012 12:44 PM, Bart Janssens wrote: > On Sun, Jun 24, 2012 at 1:10 AM, Eric Niebler wrote: >> Data parameter uses a slot mechanism >> >> In proto today, transforms take 3 parameters: expression, state and >> data. As you can see from above, transforms i

Re: [proto] proto-11 progress report

2012-06-25 Thread Eric Niebler
On 6/25/2012 12:21 PM, Mathias Gaunard wrote: > On 24/06/2012 01:10, Eric Niebler wrote: > >> As for what is not changing: >> >> Grammars, Transforms and Algorithms >> === >> It would be wonderful if there were a more natural syntax for describing >> proto algorithm

Re: [proto] proto-11 progress report

2012-06-25 Thread Bart Janssens
On Sun, Jun 24, 2012 at 1:10 AM, Eric Niebler 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

Re: [proto] proto-11 progress report

2012-06-25 Thread Mathias Gaunard
On 24/06/2012 01:10, Eric Niebler wrote: As for what is not changing: Grammars, Transforms and Algorithms === It would be wonderful if there were a more natural syntax for describing proto algorithms rather than with structs, function objects, proto::or_, proto::

Re: [proto] proto-11 progress report

2012-06-25 Thread Eric Niebler
On 6/25/2012 12:39 AM, Joel Falcou wrote: > On 06/24/2012 01:10 AM, Eric Niebler wrote: >>int i = LambdaEval()(_1 + 42, 0, proto::tag::data = 8); >> >> The 3rd parameter associates the value 8 with the data tag. > > How do you set up n

Re: [proto] proto-11 progress report

2012-06-25 Thread Joel Falcou
On 06/24/2012 01:10 AM, Eric Niebler wrote: I've made some good progress on the C++11 proto rewrite that I'd like to share. So far, it's been a less radical shift than I expected. You didn't try hard enough ;) Expressions vs. Grammars Many new users are confused by th