jastrachan | 18 Feb 08:51 2005

Re: double checking precedence rules

On 18 Feb 2005, at 07:23, Chris Poirier wrote:
> Hi James,
>> Its interesting comparing the Classic Groovy precedence rules against
>> Java's (which is where the New Groovy took its rules from to start
>> with)
> You and I did discuss the precedences at length back when the current
> parser was implemented.

I don't remember going into too much detail on precedence before. e.g. 
I didn't have much of a clue where =~ and ==~ really should go :)

> I'd say changing them now should be done only
> for good reason, as we had good reason for changing them then.

Using Java's precedence rules by default so that users won't get 
confused, seems a pretty good thing to me. We never spent the time & 
thought too hard on the 'classic' precedence rules and compared them to 
Java's. And there's only a couple of new operators we add (<=>, =~, 
==~) so it would seem wise to just use Java's and figure out what the 
delta's should be.

Note that I've not yet found a single test case / use case in our SCM 
that has failed as a result of the move to Java precedence rules. I'm 
sure the classic grammar could confuse Java-precedence-rules-savvy 
users at some point. So I don't think most users with notice much 
difference; its more to avoid the odd strange surprise that someone 
might trip over later on