<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="City"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
h1
        {margin-top:12.0pt;
        margin-right:0in;
        margin-bottom:3.0pt;
        margin-left:0in;
        page-break-after:avoid;
        font-size:16.0pt;
        font-family:Arial;
        font-weight:bold;}
h2
        {margin-top:12.0pt;
        margin-right:0in;
        margin-bottom:3.0pt;
        margin-left:0in;
        page-break-after:avoid;
        font-size:14.0pt;
        font-family:Arial;
        font-weight:bold;
        font-style:italic;}
h3
        {margin-top:12.0pt;
        margin-right:0in;
        margin-bottom:3.0pt;
        margin-left:0in;
        page-break-after:avoid;
        font-size:13.0pt;
        font-family:Arial;
        font-weight:bold;}
p.MsoCaption, li.MsoCaption, div.MsoCaption
        {margin-top:0in;
        margin-right:0in;
        margin-bottom:6.0pt;
        margin-left:0in;
        font-size:10.0pt;
        font-family:"Times New Roman";
        font-weight:bold;}
p.MsoTitle, li.MsoTitle, div.MsoTitle
        {margin-top:12.0pt;
        margin-right:0in;
        margin-bottom:3.0pt;
        margin-left:0in;
        text-align:center;
        font-size:16.0pt;
        font-family:Arial;
        font-weight:bold;}
p.MsoBodyText, li.MsoBodyText, div.MsoBodyText
        {margin-top:0in;
        margin-right:0in;
        margin-bottom:6.0pt;
        margin-left:0in;
        text-indent:.5in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
p.MsoSubtitle, li.MsoSubtitle, div.MsoSubtitle
        {margin-top:0in;
        margin-right:0in;
        margin-bottom:3.0pt;
        margin-left:0in;
        text-align:center;
        font-size:12.0pt;
        font-family:Arial;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
p.Code, li.Code, div.Code
        {margin:0in;
        margin-bottom:.0001pt;
        background:#F3F3F3;
        border:none;
        padding:0in;
        font-size:9.0pt;
        font-family:"Courier New";}
span.EmailStyle23
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Anyone else use Please Excuse My Dear Aunt
Sally? (Parentheses, Exponentiation, Multiplication, Division, Addition,
Subtraction)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <b><span style='font-weight:bold'>On
Behalf Of </span></b>Edson Tirelli<br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, April 09, 2008
2:39 PM<br>
<b><span style='font-weight:bold'>To:</span></b> Rules Users List<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [rules-users] Order
of operations</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
Hi Joe,<br>
<br>
It seems someone skipped the elementary math lessons at school...
:(<br>
<br>
Will open a JIRA for that.<br>
<br>
[]s<br>
Edson<o:p></o:p></span></font></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>2008/4/9 Joe White <<a href="mailto:Joe.White@recondotech.com">Joe.White@recondotech.com</a>>:<o:p></o:p></span></font></p>
<div link=blue vlink=purple>
<div>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>I have a
question regarding order of operations in the consequence of a rule when using
the mvel dialect. When executed the Drl below provides </span></font><font
size=2 color=black><span style='font-size:10.0pt;color:black'>Right =30.0</span></font><font
size=2><span style='font-size:10.0pt'> and <font color=black><span
style='color:black'>Wrong =140.0. The only difference is the parens around the
multiplying expressions, which shouldn't be necessary given order of
operations. Is this a problem with the drools/mvel interaction or is it
completely an issue with mvel? </span></font></span></font><o:p></o:p></p>
<p><font size=2 color=black face="Times New Roman"><span style='font-size:10.0pt;
color:black'> </span></font><o:p></o:p></p>
<p><font size=2 color=black face="Times New Roman"><span style='font-size:10.0pt;
color:black'>Is the general expectation that all expressions must be completely
scoped by parens when using mvel? </span></font><o:p></o:p></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'> <o:p></o:p></span></font></p>
<p><b><font size=2 color="#960000" face="Times New Roman"><span
style='font-size:10.0pt;color:#960000;font-weight:bold'>package</span></font></b><font
size=2 color=black><span style='font-size:10.0pt;color:black'> test;</span></font><o:p></o:p></p>
<p><b><font size=2 color="#960000" face="Times New Roman"><span
style='font-size:10.0pt;color:#960000;font-weight:bold'>dialect</span></font></b><font
size=2 color=black><span style='font-size:10.0pt;color:black'> </span></font><font
size=2 color=green><span style='font-size:10.0pt;color:green'>"mvel"</span></font><o:p></o:p></p>
<p><b><font size=2 color="#960000" face="Times New Roman"><span
style='font-size:10.0pt;color:#960000;font-weight:bold'>rule</span></font></b><font
size=2 color=black><span style='font-size:10.0pt;color:black'> </span></font><font
size=2 color=green><span style='font-size:10.0pt;color:green'>"test
11"</span></font><o:p></o:p></p>
<p><font size=2 color=black face="Times New Roman"><span style='font-size:10.0pt;
color:black'> </span></font><b><font size=2 color="#960000"><span
style='font-size:10.0pt;color:#960000;font-weight:bold'>when</span></font></b><o:p></o:p></p>
<p><font size=2 face="Times New Roman"><span style='font-size:10.0pt'> </span></font><o:p></o:p></p>
<p><font size=2 color=black face="Times New Roman"><span style='font-size:10.0pt;
color:black'> </span></font><b><font size=2 color="#960000"><span
style='font-size:10.0pt;color:#960000;font-weight:bold'>then</span></font></b><o:p></o:p></p>
<p><font size=2 color=black face="Times New Roman"><span style='font-size:10.0pt;
color:black'> </span></font><b><font
size=2 color="#960000"><span style='font-size:10.0pt;color:#960000;font-weight:
bold'>double</span></font></b><font size=2 color=black><span style='font-size:
10.0pt;color:black'> rightVal=((10-5)*2) + (5*(8-4));</span></font><o:p></o:p></p>
<p><font size=2 color=black face="Times New Roman"><span style='font-size:10.0pt;
color:black'> </span></font><b><font
size=2 color="#960000"><span style='font-size:10.0pt;color:#960000;font-weight:
bold'>double</span></font></b><font size=2 color=black><span style='font-size:
10.0pt;color:black'> wrongVal=(10-5)*2 + 5*(8-4);</span></font><o:p></o:p></p>
<p><font size=2 face="Times New Roman"><span style='font-size:10.0pt'> </span></font><o:p></o:p></p>
<p><font size=2 color=black face="Times New Roman"><span style='font-size:10.0pt;
color:black'> System.out.println(</span></font><font
size=2 color=green><span style='font-size:10.0pt;color:green'>"Right
="</span></font><font size=2 color=black><span style='font-size:10.0pt;
color:black'>+rightVal);</span></font><o:p></o:p></p>
<p><font size=2 color=black face="Times New Roman"><span style='font-size:10.0pt;
color:black'> System.out.println(</span></font><font
size=2 color=green><span style='font-size:10.0pt;color:green'>"Wrong
="</span></font><font size=2 color=black><span style='font-size:10.0pt;
color:black'>+wrongVal);</span></font><o:p></o:p></p>
<p><b><font size=2 color="#960000" face="Times New Roman"><span
style='font-size:10.0pt;color:#960000;font-weight:bold'>End</span></font></b><o:p></o:p></p>
<p><b><font size=2 color="#960000" face="Times New Roman"><span
style='font-size:10.0pt;color:#960000;font-weight:bold'> </span></font></b><o:p></o:p></p>
<p><b><font size=2 color="#960000" face="Times New Roman"><span
style='font-size:10.0pt;color:#960000;font-weight:bold'>After execution:</span></font></b><o:p></o:p></p>
<p><font size=2 color=black face="Times New Roman"><span style='font-size:10.0pt;
color:black'>Right =30.0</span></font><font size=2><span style='font-size:10.0pt'>
</span></font><o:p></o:p></p>
<p><font size=2 color=black face="Times New Roman"><span style='font-size:10.0pt;
color:black'>Wrong =140.0</span></font><o:p></o:p></p>
<p><font size=2 color=black face="Times New Roman"><span style='font-size:10.0pt;
color:black'> </span></font><o:p></o:p></p>
<p><font size=2 color=black face="Times New Roman"><span style='font-size:10.0pt;
color:black'> </span></font><o:p></o:p></p>
<p><font size=2 color=black face="Times New Roman"><span style='font-size:10.0pt;
color:black'>Thank you for all of your help. We are using drools <a
href="http://4.0.4." target="_blank">4.0.4.</a></span></font><o:p></o:p></p>
<p><font size=2 color=black face="Times New Roman"><span style='font-size:10.0pt;
color:black'> </span></font><o:p></o:p></p>
<p><font size=2 color=black face="Times New Roman"><span style='font-size:10.0pt;
color:black'>Joe</span></font><o:p></o:p></p>
<p><font size=2 color=black face="Times New Roman"><span style='font-size:10.0pt;
color:black'> </span></font><o:p></o:p></p>
<p><font size=2 color=black face="Times New Roman"><span style='font-size:10.0pt;
color:black'>Also, I haven't figured out how it arrives at 140. The following
format also produces 140, which seems a little more strange.</span></font><o:p></o:p></p>
<p><font size=2 face="Times New Roman"><span style='font-size:10.0pt'>
<b><span style='font-weight:bold'>double</span></b> wrongVal=10-5*2 + 5*8-4;</span></font><o:p></o:p></p>
<p><font size=2 face="Times New Roman"><span style='font-size:10.0pt'> </span></font><o:p></o:p></p>
<p><font size=2 face="Times New Roman"><span style='font-size:10.0pt'> </span></font><o:p></o:p></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'> <o:p></o:p></span></font></p>
</div>
</div>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><o:p></o:p></span></font></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br clear=all>
<br>
-- <br>
Edson Tirelli<br>
JBoss Drools Core Development<br>
Office: +55 11 3529-6000<br>
<st1:City w:st="on"><st1:place w:st="on">Mobile</st1:place></st1:City>: +55 11
9287-5646<br>
JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>
<o:p></o:p></span></font></p>
</div>
</body>
</html>