Re: [proto] Proto Transform Questions

2011-01-18 Thread Nate Knight
Eric Niebler writes: > > This is a fun little problem. The answer is very simple, but requires > some knowledge of proto's pass_through transform, possessed by > proto::nary_expr (and friends): > Eric, Thanks for the pointers. I had tried this with nary_expr, but had some trouble distributin

Re: [proto] Proto Transform Questions

2011-01-15 Thread Eric Niebler
On 1/15/2011 6:41 AM, Nate Knight wrote: > On Jan 14, 2011, at 12:29 PM, Nate Knight wrote: > >> I've pasted some code below where I am trying to transform expressions of >> the form >> >> (a op b op c)[i] >> >> to >> >> (a[i] op b[i] op c[i]) >> >> I managed to get this to work for the simple

Re: [proto] Proto Transform Questions

2011-01-15 Thread Nate Knight
On Jan 14, 2011, at 12:29 PM, Nate Knight wrote: > I've pasted some code below where I am trying to transform expressions of the > form > > (a op b op c)[i] > > to > > (a[i] op b[i] op c[i]) > > I managed to get this to work for the simple case > > (a+b)[i] > > but I'm curious about how

[proto] Proto Transform Questions

2011-01-15 Thread Nate Knight
I've pasted some code below where I am trying to transform expressions of the form (a op b op c)[i] to (a[i] op b[i] op c[i]) I managed to get this to work for the simple case (a+b)[i] but I'm curious about how to generalize this to include other operators (without explicitly handling the