Hmmmmm....<br><br>Personally, I don&#39;t like the use of &quot;:&quot; i isolation as it&#39;s what we currently use to bind variables and I feel &quot;cheese:&quot; as an output definition could just make people question whether they&#39;ve missed something. Perhaps &quot;cheese : ?&quot; would be a viable alternative. This would be in keeping with (a) current variable declaration, (b) the use of &quot;?&quot; to identify a call to a query. Geoffrey&#39;s examples would then become:-<br>
<br><code>rule</code>
      <code>outputinput<br>
      </code><code>when</code>
    <div><code>    </code><code>Here( loc : location) </code></div>
    <div><code>    </code><code>?</code><code>editableThings</code><code>(food : ?, </code><code>loc</code><code>;)</code></div>
    <div><code>then</code><br>
          System.out.println(&quot;Food &quot; + food + &quot; at location &quot; + loc);<br>
          // Output:<br>
          // Food crackers at location kitchen<br>
          // Food apple at location kitchen</div>
    <div><code>end<br>
      </code><br>
      <div><code>rule</code>
        <code>outputOutput<br>
        </code><code>when</code></div>
      <div><code>    </code><code>?</code><code>editableThings</code><code>(food : ?, </code><code>loc : ?</code><code>;)</code></div>
      <div><code>then</code><br>
            System.out.println(&quot;Food &quot; + food + &quot; at location &quot; + loc);<br>
            // Output:<br>
            // Food crackers at location kitchen<br>
            // Food apple at location kitchen<br>
            // Food chocolate at location living room<br>
            // Food chips at location living room
      </div>
      <div><code>end<br>
          <br>
        </code>
        <div><code>rule</code> <code>typo<br>
          </code><code>when</code></div>
        <div><code>    </code><code>Here( looc : location) </code></div>
        <div><code>    </code><code>?</code><code>editableThings</code><code>(food : ?, </code><code>loc : ?</code><code>;)</code></div>
        <div><code>then</code><br>
              System.out.println(&quot;Food &quot; + food + &quot; at location &quot; + loc);<br>
              // Output:<br>
              // Food crackers at location kitchen<br>
              // Food apple at location kitchen<br>
              // Food chocolate at location living room<br>
              // Food chips at location living room<br>    // looc is just an unused bound variable<br></div>
        <div><code>end</code></div></div></div><br><br><div class="gmail_quote">On 20 April 2011 10:16, Geoffrey De Smet <span dir="ltr">&lt;<a href="mailto:ge0ffrey.spam@gmail.com">ge0ffrey.spam@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

  

    
  
  <div text="#000000" bgcolor="#ffffff">
    Mark and I were discussing backwards chaining<br>
     
    <a href="http://blog.athico.com/2011/04/backward-chaining-emerges-in-drools.html" target="_blank">http://blog.athico.com/2011/04/backward-chaining-emerges-in-drools.html</a><br>
    on IRC and we &#39;d like your opinion on a design issue.<br>
    <br>
    The example<br>
    ========<br>
    <br>
    Let&#39;s say you have this data:<br>
      Location(&quot;crackers&quot;, &quot;kitchen&quot;)<br>
      Location(&quot;apple&quot;, &quot;kitchen&quot;)<br>
      Location(&quot;chocolate&quot;, &quot;living room&quot;)<br>
      Location(&quot;chips&quot;, &quot;living room&quot;)<br>
    <br>
    Let&#39;s say you have this code:<br>
    <br>
    <div><code>query</code>
      <code>editableThings( String thing, String
        location ) </code></div>
    <div><code>    </code><code>Location(thing, location)</code></div>
    <div><code>end</code></div>
    <br>
    And then these 3 rules:<br>
    <br>
    <div><code>rule</code>
      <code>outputinput<br>
      </code><code>when</code></div>
    <div><code>    </code><code>Here( loc : location) </code></div>
    <div><code>    </code><code>?</code><code>editableThings</code><code>(food, </code><code>loc</code><code>;)</code></div>
    <div><code>then</code><br>
          System.out.println(&quot;Food &quot; + f + &quot; at location &quot; + loc);<br>
          // Output:<br>
          // Food crackers at location kitchen<br>
          // Food apple at location kitchen</div>
    <div><code>end<br>
      </code><br>
      <div><code>rule</code>
        <code>outputOutput<br>
        </code><code>when</code></div>
      <div><code>    </code><code>?</code><code>editableThings</code><code>(food, </code><code>loc</code><code>;)</code></div>
      <div><code>then</code><br>
            System.out.println(&quot;Food &quot; + f + &quot; at location &quot; + loc);<br>
            // Output:<br>
            // Food crackers at location kitchen<br>
            // Food apple at location kitchen<br>
            // Food chocolate at location living room<br>
            // Food chips at location living room
      </div>
      <div><code>end<br>
          <br>
        </code>
        <div><code>rule</code> <code>typo<br>
          </code><code>when</code></div>
        <div><code>    </code><code>Here( looc : location) </code></div>
        <div><code>    </code><code>?</code><code>editableThings</code><code>(food, </code><code>loc</code><code>;)</code></div>
        <div><code>then</code><br>
              System.out.println(&quot;Food &quot; + f + &quot; at location &quot; + loc);<br>
              // Output:<br>
              // Food crackers at location kitchen<br>
              // Food apple at location kitchen<br>
              // Food chocolate at location living room<br>
              // Food chips at location living room</div>
        <div><code>end</code></div>
        <br>
      </div>
      <br>
    </div>
    The discussion<br>
    =========<br>
    <br>
    Both rules have the same statement:<br>
      <code>?</code><code>editableThings</code><code>(food, </code><code>loc</code><code>;)</code><br>
    <br>
    <code></code>In the outputInput rule, &quot;<code></code><code>loc</code><code></code>&quot; is an input variable.<br>
    <code></code>In the outputOutput rule, &quot;<code></code><code>loc</code><code></code>&quot; is an output variable.<br>
    <br>
    I am wondering if we don&#39;t need a visual demarcation that a variable
    is an output variable,<br>
    to make it stand out of an input variable?<br>
    <br>
    Proposition 1: Suffix output variables with &quot;:&quot;<br>
    <br>
    <div><code>rule</code>
      <code>outputinput<br>
      </code><code>when</code></div>
    <div><code>    </code><code>Here( loc : location) </code></div>
    <div><code>    </code><code>?</code><code>editableThings</code><code>(food:, </code><code>loc</code><code>;)</code></div>
    <div><code>then
        ... end<br>
        <br>
      </code>
      <div><code>rule</code>
        <code>outputOutput<br>
        </code><code>when</code></div>
      <div><code>    </code><code>?</code><code>editableThings</code><code>(food:, </code><code>loc:</code><code>;)</code></div>
      <div><code>then
          ... end</code><code></code></div>
      <br>
      <div><code>rule</code>
        <code>typo<br>
        </code><code>when</code></div>
      <div><code>    </code><code>Here( looc : location) </code></div>
      <div><code>    </code><code>?</code><code>editableThings</code><code>(food:, </code><code>loc</code><code>;) // compiler error because input variable
          loc is not declared</code><code></code>
        <div><code>then ... end</code></div>
      </div>
    </div>
    <br>
    <br>
    -- <br>
    With kind regards,<br><font color="#888888">
    Geoffrey De Smet
  </font></div>

<br>_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
<br></blockquote></div><br>