So as not to confuse everybody - it seems that the 5.1 textual version of a dsl now looks like this:<br><br>[condition][]There is an element {eVar}={eVar} : Element()<br>[condition][]- called {nVar}={nVar} : name<br>[condition][]- other than {oVar}=this != {oVar}<br>
[condition][]- where {eVar} is disjoint from {oVar}=eval( {eVar}.disjointWith( {oVar} ) )<br>[condition][]- where {eVar} intersects with {oVar}=eval( ! {eVar}.disjointWith( {oVar} ) )<br>[consequence][]show disjoint {n1Var} and {n2Var}=System.out.println( {n1Var} + &quot; and &quot; + {n2Var} + &quot; are disjoint.&quot;);<br>
[consequence][]show intersecting {n1Var} and {n2Var}=System.out.println( {n1Var} + &quot; and &quot; + {n2Var} + &quot; intersect.&quot;);<br><br>(The documentation is not up-to-date, is it?)<br><br>-W<br><br><br>On 26 August 2010 16:15, Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;</span> wrote:<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">It is possible to hide the eval for computing the intersection in a DSL.<br>

<br>
Given<br>
<br>
public class Element {<br>
    private String name;<br>
    private Set&lt;Integer&gt; numbers;<br>
    public Element( String name, Integer... numbers ){ ... }<br>
    // getters...<br>
    public boolean disjointWith( Element other ){<br>
        Set&lt;Integer&gt; ownNumbers = new HashSet&lt;Integer&gt;( this.numbers );<br>
        ownNumbers.retainAll( other.getNumbers() );<br>
        return ownNumbers.isEmpty();<br>
    }<br>
}<br>
<br>
and the dsl<br>
<br>
[when]There is an element {eVar}={eVar} : Element()<br>
[when]- called {nVar}={nVar} : name<br>
[when]- other than {oVar}=this != {oVar}<br>
[when]- where {eVar} is disjoint from {oVar}=eval(<br>
{eVar}.disjointWith( {oVar} ) )<br>
[when]- where {eVar} intersects with {oVar}=eval( !<br>
{eVar}.disjointWith( {oVar} ) )<br>
[then]show disjoint {n1Var} and {n2Var}=System.out.println( {n1Var} +<br>
&quot; and &quot; + {n2Var} + &quot; are disjoint.&quot;);<br>
[then]show intersecting {n1Var} and {n2Var}=System.out.println(<br>
{n1Var} + &quot; and &quot; + {n2Var} + &quot; intersect.&quot;);<br>
<br>
you can write the drsl<br>
<br>
package appl.domain<br>
expander elements.dsl<br>
<br>
rule &quot;find disjoint pairs&quot;<br>
when<br>
    There is an element e1<br>
    - called n1<br>
    There is an element e2<br>
    - called n2<br>
    - other than e1<br>
    - where e1 is disjoint from e2<br>
then<br>
        show disjoint n1 and n2<br>
end<br>
<div class="im"><br>
On 25 August 2010 16:55, mechlife &lt;<a href="mailto:gaiamech@gmail.com">gaiamech@gmail.com</a>&gt; wrote:<br>
&gt;<br>
</div><div><div></div><div class="h5">&gt; Thanks for your response.<br>
&gt;<br>
&gt; I need to use it like 1-4 times depending on what the legacy rules are setup<br>
&gt; on one rule but i do have thousands of rules.<br>
&gt; Also, a future state might be to get these imported into a tool for business<br>
&gt; users to start writing these and would definitely be more pleasing if they<br>
&gt; had an operator that they could use.<br>
&gt; Would you be able to point me to some resources on how to do the custom<br>
&gt; operator<br>
&gt; if the need arise.<br>
&gt;<br>
&gt; thanks again for your time.<br>
&gt; --<br>
&gt; View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/comparing-an-intersection-of-sets-tp1313555p1332184.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/comparing-an-intersection-of-sets-tp1313555p1332184.html</a><br>

&gt; Sent from the Drools - User mailing list archive at Nabble.com.<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
</div></div></blockquote></div><br>