[rules-dev] accumulate to acc
Mark Proctor
mproctor at codehaus.org
Thu Aug 18 13:27:31 EDT 2011
On 18/08/2011 18:17, Wolfgang Laun wrote:
> On 18 August 2011 18:38, Mark Proctor <mproctor at codehaus.org
> <mailto:mproctor at codehaus.org>> wrote:
>
> We are looking to tighten up accumulate, using a new keyword to
> differentiate. It will use ; for separation, to follow a similar
> form to
> a 'for' loop.
>
> acc( CE*;
> <func>*;
> <guard>? )
>
> so something like:
>
> acc( $o : Order();
> $min : min( $o.value ),
> $max : max($o.value);
> $min > 100 && $max < 100 )
>
>
> Given that I can do this today using an eval after the accumulate CE:
> What's the big gain, as compared to the nuisance of yet another CE,
> with the need to document (which, traditionally, isn't done so
> eagerly) and teach and learn and getting it free of bugs?
I find the above looks cleaner and easier to read, the more we can
reduce the need for 'eval' the better. It is a common enough use case
that I feel it is worth support. Acc is used a lot for CEP use cases and
we need a syntax that can compete succinctly with alternative approaches
- if we look like a dog dinner, we'll lose out to alternative CEP
syntaxes. The separation of the segments using ";" gives a clearer
distinction too, and it's 'for' loop like nature should more natural to
people new to the engine.
Mark
>
> -W
>
>
> I have wondered if we could use pipes on our functions, to be able to
> pass the results of one function into another - just not sure how that
> will work or look yet.
> func(...) in func(...)
> func(...) | func(...)
>
> Mark
>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org <mailto:rules-dev at lists.jboss.org>
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
>
>
>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20110818/8dc01352/attachment.html
More information about the rules-dev
mailing list