Adding new keywords is not as impossible as it might seem. It depends on the place the new keyword should appear. Almost all keywords are now recognized depending on the symbol(s) before or after. This makes the parser somewhat vulnerable w.r.t. garbage input token sequences, but there&#39;s no way around that.<br>
<br>As for the &quot;acc&quot; proposal itself, I find that<br><br>dontCallItAcc( Foo( $x:x ...);<br>                      $max: min($x), $min: max($x);<br>                      $max - $min &gt; 100 )<br><br>as a CE is not <i>declarative</i> enough. If I&#39;d like to do the same thing for a Bar(), I&#39;d have to write it all over again. For instance, if there were a <br>
   declare MinMax( Number n )<br>      min : Number from min( n );<br>      max : Number from max( n )<br>   end<br>I might use this in more than one place:<br>   Foo( $x: x ) | MinMax( $x )( max - min &gt; 100 ) <br>   Bar( $y: y )  | MinMax( $y )( max - min &gt; 200 )<br>
<br>-W<br><br><div class="gmail_quote">On 22 August 2011 10:18, 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="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<u></u>

  
    
    
  
  <div text="#000000" bgcolor="#ffffff">
    <br>
    <br>
    Op 20-08-11 00:42, Mark Proctor schreef:
    <blockquote type="cite">
      <pre>On 19/08/2011 12:42, Geoffrey De Smet wrote:
</pre>
      <blockquote type="cite">
        <pre>&quot;Good programmers appreciate what you put in,
Great programmers appreciate what you leave out &quot;
   -- Josh Bloch

I also believe that having 2 accumulates is just going to bring
confusion and complexity.
</pre>
      </blockquote>
      <pre>Over time we&#39;ll deprecate the old accumulate. But we must evolve the 
language to improve it, it&#39;s not easier as there is no one to copy for 
this, it&#39;s virgin territory. That means we can&#39;t be afraid to try 
things, and change them if think we can improve it.

Mark</pre>
    </blockquote>
    I am not against adding new features to the language. (*)<br>
    But don&#39;t call it &quot;acc&quot; or &quot;accumulate&quot;, that will just confuse
    everyone.<br>
    <br>
    Call it &quot;gather&quot;, collect, hoard, amass, pileUp, cumulate,
    conglomerate, ... anything but accumulate or an abbreviation.<br>
      <a href="http://www.thefreedictionary.com/accumulate" target="_blank">http://www.thefreedictionary.com/accumulate</a><br>
    <br>
    <b>Using the same term for 2 different things greatly disrupts
      communication (= API, manual, code readability, ...).</b><br>
    The 2 WorkingMemory (= same term for 2 different things) are still
    causing confusion:<br>
      org.drools.WorkingMemory<br>
      org.drools.runtime.rule.WorkingMemory<br>
    You can even mix them in your code (several planner examples did
    that for a couple of years before I noticed it).<br>
    Let&#39;s investigate ways to clean that up first? For example: move the
    old one to drools-core-legacy-api already, before we completely
    remove it.<br>
    <br>
    <pre cols="72">With kind regards,
Geoffrey De Smet</pre>
    <br>
    <br>
    (*) I do believe we need a more future proof system of adding
    keywords and features. I see 2 alternatives:<br>
    A) Specify a drlModel version in the DRL. This allows backwards
    incompatible changes between drlModel versions, but new drools jars
    should still support the last 3 drlModel versions. This is similar
    to:<br>
    -- pom.xml&#39;s &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;<br>
    B) Find a way to reserve keywords.<br>
    -- By having to import the keywords?<br>
        import keyword org.drools.parser.acc; // I can now use acc in my
    rules<br>
        import keyword org.drools.parser.thenElse; // I can now use
    thenElse in my rules<br>
    -- By prefixing the keywords with a reserved character.<br>
       For example: @acc, @thenElse or #acc, #thenElse<br>
    -- Like Ceylon, by layout (probably not possible): &quot;Note also that
    annotations like doc, by, see, and deprecated aren&#39;t keywords.
    They&#39;re just ordinary identifiers. The same is true for annotations
    which are part of the language definition: abstract, variable,
    shared, formal, actual, and friends. On the other hand, void is a
    keyword. &quot;<br><font color="#888888">
    <pre cols="72">-- 

</pre>
  </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>