Certainly, and it's more to the point - thank you!<br><br>Nevertheless, the compiler hiccup ought to be investigated<br>-W<br><br><br><div class="gmail_quote">On Wed, Sep 2, 2009 at 5:31 PM, Greg Barton <span dir="ltr"><<a href="mailto:greg_barton@yahoo.com">greg_barton@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Is Collection.containsAll() an option?<br>
<br>
--- On Wed, 9/2/09, Wolfgang Laun <<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>> wrote:<br>
<br>
> From: Wolfgang Laun <<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>><br>
> Subject: [rules-users] forall/from/eval/contains: odd DRL syntax error<br>
> To: "Rules Users List" <<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>><br>
> Date: Wednesday, September 2, 2009, 9:58 AM<br>
<div><div></div><div class="h5">> A rule has to ascertain that all elements in<br>
> a List<ElemBoxStatus>in a<br>
> Collector occur in the matching BoxResponse's <br>
> Set<ElemBoxStatus>. There is<br>
> just one BoxResponse per Collector.<br>
><br>
> This here works fine:<br>
><br>
><br>
> rule matchCollectorResponse<br>
> when<br>
> $c : Collector( $ebsList :<br>
> elemBoxStatusList, $gsSet : globalStatusSet )<br>
> $b : BoxResponse( collector == $c,<br>
> globalStatusSet == $gsSet, $ebsSet : elemBoxStatusSet )<br>
><br>
> forall( $ebs : ElemBoxStatus() from<br>
> $ebsList<br>
> BoxResponse( collector ==<br>
> $c, elemBoxStatusSet contains $ebs ) )<br>
> then<br>
> ...<br>
> end<br>
><br>
> Thinking that $ebs is already available from the second<br>
> pattern ($b:...), I tried<br>
><br>
><br>
> rule matchCollectorResponse<br>
> when<br>
> $c : Collector( $ms : message, $ebsList :<br>
> elemBoxStatusList, $gsSet : globalStatusSet )<br>
> $b : BoxResponse( collector == $c,<br>
> globalStatusSet == $gsSet, $ebsSet : elemBoxStatusSet )<br>
><br>
> forall( $ebs : ElemBoxStatus() from<br>
> $ebsList<br>
> eval( $ebsSet.contains(<br>
> $ebs ) ) )<br>
> then<br>
> ...<br>
> end<br>
><br>
> but the compiler came back with<br>
><br>
> Line ...:55 no viable alternative at input '$ebs'<br>
> in rule matchCollectorResponse in pattern eval<br>
><br>
><br>
> Defining a suitable function isIn(...) and using this<br>
> within eval() produces the same result. This<br>
> and other experiments seems to indicate that bindings in<br>
> the first pattern of forall() are not<br>
> passed in to an eval() later in the forall.<br>
><br>
><br>
> JIRA?<br>
><br>
> -W<br>
><br>
><br>
><br>
</div></div>> -----Inline Attachment Follows-----<br>
><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><br>
><br>
<br>
<br>
<br>
<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><br>
</blockquote></div><br>