On 22/08/2011 09:18, Geoffrey De Smet wrote:


Op 20-08-11 00:42, Mark Proctor schreef:
On 19/08/2011 12:42, Geoffrey De Smet wrote:
"Good programmers appreciate what you put in,
Great programmers appreciate what you leave out "
   -- Josh Bloch

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

Mark
I am not against adding new features to the language. (*)
But don't call it "acc" or "accumulate", that will just confuse everyone.
The other keyword being discussed is 'for'.

Once 'for' is in place 'accumulate' will be removed from the documentation, or atleast relegated t a deprecate stage, so it's only there for backwards comptability.

Mark

Call it "gather", collect, hoard, amass, pileUp, cumulate, conglomerate, ... anything but accumulate or an abbreviation.
  http://www.thefreedictionary.com/accumulate

Using the same term for 2 different things greatly disrupts communication (= API, manual, code readability, ...).
The 2 WorkingMemory (= same term for 2 different things) are still causing confusion:
  org.drools.WorkingMemory
  org.drools.runtime.rule.WorkingMemory
You can even mix them in your code (several planner examples did that for a couple of years before I noticed it).
Let'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.

With kind regards,
Geoffrey De Smet


(*) I do believe we need a more future proof system of adding keywords and features. I see 2 alternatives:
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:
-- pom.xml's <modelVersion>4.0.0</modelVersion>
B) Find a way to reserve keywords.
-- By having to import the keywords?
    import keyword org.drools.parser.acc; // I can now use acc in my rules
    import keyword org.drools.parser.thenElse; // I can now use thenElse in my rules
-- By prefixing the keywords with a reserved character.
   For example: @acc, @thenElse or #acc, #thenElse
-- Like Ceylon, by layout (probably not possible): "Note also that annotations like doc, by, see, and deprecated aren't keywords. They'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. "
-- 



_______________________________________________
rules-dev mailing list
rules-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev