[rules-dev] sugar

Mark Proctor mproctor at codehaus.org
Tue Mar 20 15:54:06 EDT 2007


Could also allow:
Cheese( name = Person( location == "london").favourCheese )

Can also use this to constrain on the fact itself, instead of just a field:
Person( cheese = Cheese( type == "stilton ) )

This could be use in config options:
Call( duration < CallConf().minDuration )

But as Edson pointed out it is open to abuse and misunderstanding, how 
long till people do:
Call( duration < CallConf().maxDuration, duration > CallConf().maxDuration )

Which is more like doing the following which has cross product issues:
CallConf( $maxDuration1 : maxDuration )
CallConf( $maxDuration2 : maxDuration )
Call( duration < ,$maxDuration1 duration > $maxDuration2 )

Mark
Mark Proctor wrote:
> I've been thinking of an idea to make rules more expressive, its just 
> syntax sugar at the parser level, but thought i'd ask feedback - if 
> anyone with antlr skills wants to make this work, let us know :)
>
> Instead of doing:
> $p : Person($favouriteCheese : favouriteCheese )
> Cheese( name == $favouriteCheese )
>
> We should allow the following:
> $p : Person()
> Cheese( name == $p.favouriteCheese )
>
> We could take this further and in places where a pattern is not used 
> elsewhere allow:
> Cheese( name == Person().favouriteCheese )
>
> Mark
>
>
>
> _______________________________________________
> rules-dev mailing list
> rules-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>




More information about the rules-dev mailing list