Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4519021
Votes 0
Synopsis RFE: Addition of "and", "or", and "not" keywords
Category java:specification
Reported Against merlin-beta2
Release Fixed
State 11-Closed, Will Not Fix, request for enhancement
Priority: 4-Low
Related Bugs
Submit Date 24-OCT-2001
Description





ISO C++ recognizes several "synonym" keyword tokens as part of the language;
ISO C provides a standard header file <iso646.h> which defines macros that
provide the same functionality as the C++ keywords.  This request for
enhancement deals specifically with three of those keywords: 'and', 'or',
and 'not'.

While I realize that Java is not C or C++, it still would be convenient to be
able to use keywords 'and', 'or', and 'not' in place of the existing logical
operators '&&', '||', and '!', respectively.   The intent is to render logical
expressions a little more human-readable.

    if (a > b  ||  !big  &&  a != null) ...        // old
    if (a > b  or  not big  and  a != null) ...    // new

Personally, I find the English words more immediately understandable than the
old C punctuation operators.

Note that this request does not advocate the adoption of the other ISO C++
synonym keywords (e.g., 'xor_eq').  The other operators ('~', '>', etc.) look
fine to me as they are.  Nor does this request advocate eliminating the
existing logical operators, but simply adding additional synonyms for them.

The drawback to this proposal, of course, is that it carries a low
benefits-to-weight ratio.  And adding the new keywords might break existing
code (though I think this is fairly unlikely).  This would probably be placed
in the "syntactic sugar" category.
(Review ID: 134396) 
======================================================================
Work Around
N/A
Evaluation
Adding keywords is extremely disruptive in a widely used language.
Adding them as pointless sugar is out of the question.

 xxxxx@xxxxx  2001-10-25
Comments
  
  Include a link with my name & email   

Submitted On 05-DEC-2001
davidtribble
And yet the ISO C++ committee went through all the trouble of adding
these new synonym keywords to C++, and it's older than Java.



PLEASE NOTE: JDK6 is formerly known as Project Mustang