<br>when<br>   Map( this[&quot;type&quot;] == &quot;Point&quot;, $x : this[&quot;x&quot;] )<br>   Map( this[&quot;type&quot;] == &quot;Circle&quot;, x == $x )<br>then<br>end<br> <br><br><div class="gmail_quote">2009/8/19 André Thieme <span dir="ltr">&lt;<a href="mailto:address.good.until.2009.dec.14@justmail.de">address.good.until.2009.dec.14@justmail.de</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Edson Tirelli schrieb:<br>
<div class="im"><br>
&gt;         when<br>
&gt;                Customer( $custId : id )<br>
&gt;                DailyOrders( count[$custId] == 1 )<br>
&gt;         then<br>
<br>
</div>Btw, this brings me to a new syntax question for the default Drools rule<br>
syntax. Is this possible:<br>
<br>
when<br>
   m:Map()<br>
   eval( m.get(&quot;type&quot;) == &quot;Point&quot;, $x : m.get(&quot;x&quot;) )<br>
   ...<br>
   Circle( x == $x )<br>
then<br>
   ...<br>
<br>
<br>
or, an alternative which may be clearer:<br>
<br>
when<br>
   m:Map()<br>
   eval( m.get(&quot;type&quot;) == &quot;Point&quot; )<br>
   $x : m.get(&quot;x&quot;)<br>
   ...<br>
then<br>
   ...<br>
<br>
So, what I would like to have is:<br>
1) looking at all Maps which have the value &quot;Point&quot; under the key &quot;type&quot;<br>
2) of all those Maps: store in a var what value they have under key &quot;x&quot;<br>
3) reuse the var, here $x instead of having an expensive lookup over and<br>
    over again.<br>
<br>
Is that possible? Or would I have to write my example above as<br>
...<br>
c:Circle()<br>
eval(c.getX() == m.get(&quot;x&quot;))<br>
<div class="im"><br>
<br>
André<br>
--<br>
Lisp is not dead. It’s just the URL that has changed:<br>
<a href="http://clojure.org/" target="_blank">http://clojure.org/</a><br>
_______________________________________________<br>
</div><div><div></div><div class="h5">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><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>