[rules-users] MultiValueRestriction

Iftikhar Khan quant.coder at gmail.com
Wed Jun 19 09:19:02 EDT 2013


Hi Wolfgang

My question was more about if the second way of writing was more preferred
because of some solid technical reason rather than just a matter of syntax;
that's how I interpreted the text as it makes the conditional statement
"but if you are testing for equality...".

Anyway thanks for confirming that there is no difference other than coding
style.

Regards

Iftikhar

On Wednesday, 19 June 2013, Wolfgang Laun wrote:

> On 19/06/2013, droolster <quant.coder at gmail.com <javascript:;>> wrote:
> > Hello,
> >
> > I saw the following in the "Design Patterns for PRS system" pdf and could
> > not understand the difference between the two statements (they look the
> > same
> > to me). Please can the community clarify what the difference is:
>
> Just count the keystrokes :-) Probably easier to read, too.
> -W
>
> >
> > A multiple choice could be written using the same syntactic form, e.g.,
> >
> > Type( strField == "Huey" || == "Dewey" || == "Louie" )
> >
> > but if you are testing for equality, the MultiValueRestriction is to be
> > preferred, so that the preceding
> > pattern is better written as
> >
> > Type( strField in ( "Huey", "Dewey", "Louie" ) )
> >
> > Thank you,
> >
> > Iftikhar
> >
> >
> >
> > --
> > View this message in context:
> > http://drools.46999.n3.nabble.com/MultiValueRestriction-tp4024384.html
> > Sent from the Drools: User forum mailing list archive at Nabble.com.
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org <javascript:;>
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org <javascript:;>
> https://lists.jboss.org/mailman/listinfo/rules-users
>


-- 
Sent from Gmail Mobile
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20130619/1033979c/attachment.html 


More information about the rules-users mailing list