streamulus icon indicating copy to clipboard operation
streamulus copied to clipboard

Support lambda expressions

Open iritkatriel opened this issue 13 years ago • 2 comments

It would work like this:

  1. Streamulus defines placeholder terminals streamulus::_1, etc..
  2. The user defines a streamulus expression over them.
  3. Then user subscribes the expression along with actual strops that replace the placeholders.

The advantage is that expressions can be reused on different inputs.

iritkatriel avatar Jun 18 '12 13:06 iritkatriel

Consider reusing Phoenix placeholder so Phoenix expression could be directly used. There is a will to unify all palcehodlers within boost and along, so puttign one more in the pool is maybe ill-advised.

Other advantage, fi you reuse Phoenix _x: you cna just say your grammar accept expression from phoenix_domain explicitly.

my_grammar : or_< stuff, thingy, phoenix_grammar>

Then you just have to know where such expression can kicks in and do the approprite thing which is, I think, wrap it into a phoenix_strop<X> class.

jfalcou avatar Aug 08 '12 06:08 jfalcou

I like the idea of using phoenix placeholders and supporting phoenix expression. Trying to wrap my head around how it would work.

I'm not sure that putting the whole phoenix expression in a strop_phoenix is the best solution, because then the graph does not give us the fine-tuned control over which parts of the expression get updated (so that for x_x+y_y, we don't recompute y*y when x changes). So I think that the streamulus grammar should identify phoenix placeholders, but the operators should be interpreted in the normal streamulus way.

On the other hand, it might be useful to make it possible for the user to say "put this whole sub-expression in a single strop". Is there a way to do that?

iritkatriel avatar Aug 12 '12 16:08 iritkatriel