Nice : Java Glossary
home N words local find no local find frame, full screen Google search web for topic jump to footer translate with Babelfish by Roedy Green ©1996-2008 Canadian Mind Products
Go to : punctuation 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z (all)
Nice
A language like Java with some extensions. It generates JVM byte code and uses the Java standard libraries. The feature most intriguing to Java programmers is it gets rid of the NullPointerExceptions by determining at compile time if they could happen. It allows named keyword arguments in any order, or positional arguments in standard order, optional arguments with default values, support for Design by Contract. It has generics just like Java will soon have.

Catching null pointers at compile time is just one of the benefits of building the language around a reasonably powerful type system. Other benefits of precise typing will come to Java with Generics (note that GJ and Nice are based on different powerful type systems).

Nice provides both extensible data (objects) and extensible operations (functions) in a unified way. Class based extensible data is similar to Java, but Nice multi-methods are very different from Java methods.

In Nice, choice of method implementation at execution time is based on the class of all the method parameters (not just the type of the receiver object). In Nice, and at the assembler level in Java, you can think of the receiver object as just another parameter passed to a static method. In other words myObj.myMethod( myParm ) is equivalent to myMethod( myObj, myParm ). In Java, which version of myMethod that gets used depends only on the type of the myObj object. In Nice it depends on the dynamic types all the parameters — including both myObj and myParam. In other words Nice seeks a closer fit for the method based not only on the reciever’s dynamic type but on the parameters as well. Like Java, there are also static constraints on the types of the parameters. Like Java, the compiler checks there exists at least one match.

Methods can be added to an existing class without editing the source (and without subclassing). (Yes, you can add a method to String.)

Nice provides for functional programming - parameters and return types can be methods or functions, anonymous functions, closures or Hindley Milner ML based type system extended for subtypes.


CMP_homejump to top
CMP logo
feedback Please email your feedback for publication, errors, omissions, broken/redirected link reports
and suggestions to improve this page to Roedy Green : feedback email
made with CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[65.110.21.43]
Your face IP:[38.103.63.16] The information on this page is for non-military use only.
You are visitor number 8,032. Military use includes use by defence contractors.
You can get a fresh copy of this page from: or possibly from your local J: drive (Java virtual drive/Mindprod website mirror)
http://mindprod.com/jgloss/nice.html J:\mindprod\jgloss\nice.html