[rules-dev] Drools syntax diagrams - redrawn

Greg Barton greg_barton at yahoo.com
Thu Sep 23 10:29:16 EDT 2010


Yes, and I don't think we want to take readability cues from Perl. :)

GreG

On Sep 23, 2010, at 3:03, Wolfgang Laun <wolfgang.laun at gmail.com> wrote:

On 23 September 2010 09:31, Bruno Unna <bruno.unna at gmail.com> wrote:
FWIW: in Perl, there are both operators as well (|| and 'or'). However, they are *not* exactly the same. Although they can be used in any context to render a boolean expression, their priority makes the difference. Taken from official documentation (http://bit.ly/dgw4GT):


Low precedence "and", "or", "xor" were introduced to permit "Perl poetry", or, more seriously, to
permit control flow using a logical expression, especially after function calls without parentheses. 
   see Naples or die;  # same as: see(Napes) || die(); but not: see(Naples || die() );

No way this makes any sense in Drools.

-W

Binary "or" returns the logical disjunction of the two surrounding expressions. It's equivalent to || except for the very low precedence. This makes it useful for control flow.


Nonetheless, it must be taken into account that the distinction makes sense for a Perl programmer. For a rules-writing guy (or girl) perhaps the distinction is extremely obscure.

Regards.



_______________________________________________
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/20100923/c85d64f2/attachment.html 


More information about the rules-dev mailing list