Draft proposal: allow the use of relational operators on Comparable classes

Tom Hawtin Thomas.Hawtin at Sun.COM
Thu Mar 19 09:41:02 PDT 2009


Howard Lovatt wrote:
> Dots are also a bad solution because you can get confusing expressions:
> 
> 5.<.4
> 
> Is this:
> 
> (5.) < (.4)

This is a lexical issue. The lexer is greedy, so yes the tokens would be 
"5." "<" ".4"[1]. I don't believe this lexical issue would be a real 
problem in real code. For instance the expressions "f<.4" and "i.<.4" 
would both work as expected.

Tom

[1] >> and >>> are the only real oddities in Java. As well as being 
double and triple close of generics, they are some obscure operators 
that don't really belong in Java (IMO).



More information about the coin-dev mailing list