sequence
This manual describes the NICE programming language. It is currently being revised, which means that this language is still incomplete in many ways, or some parts are basically blank. During this time, it is recommended to read "Nice Tutorial" [http://nice.sf.net/language.html], which includes many additional information. Read these two documents require some Java knowledge, or at least understand an object-oriented language.
The author of this manual is Daniel Bonniot and Bryn Keller, Francis Barber is also involved.
Chapter 1 Basic Principle
A Language That Doesn't affect the way you think about programming, is not development.
-Alan j. perlis
The Art of Progress Is To Preserve Order Amid Change and To Preserve Change Amid ORDER.
-Alfred North WhiteHead
The NICE language is a new Java-oriented language-oriented language. It draws on some characteristics from the function type language and works artically to practice the research results of the college. These features make it better expressions, modular structures, and security (Safety).
safety
Nice can check more errors than existing object-oriented languages (Null Pointer Accesses). This means that programs written in Nice will no longer throw a famous NullPointRexception and ClassCastException. See http://nice.sf.net/safety.html in this regard.
Modular structure
In object-oriented languages, a new class can be added to the existing class inheritance structure. In NICE, you can also add new methods to existing classes without modifying the source file, and this is a special case of multi-Methods.
Expression
Advanced features using NICE avoid many duplicate programming tasks. Have you ever been able to write a pile of loops, type conversion, using the default value of overload method ...?
Chapter II
The package is a set of associated classes, methods, and variables. You can use the following statement to declare all the code under a package:
Package package-name;
You can import all public elements in another package using the import statement:
Import package-name;
Please note that this is slightly different from Java. Categories in a package can be independently imported in Java. In the middle of the NICE, the method can be declared outside the class, so the entire package must be imported to determine the available methods in a class. This means that the NICE project must be designed with a smaller, complete package than Java.
As mentioned above, only the entire package can be imported, but a single class is not. Similarly, there is no need to use like Java after the name. *. In fact, use. * Description You want to import a Java package instead of the NICE package. See "Interaction with Java" for details.
MAIN method
A method is included in the package, its name is Main, the return value is Void, and accepts a String [] type parameter. This method is very special, and its procedure will be executed by this main method. The runtime system will pass the command line parameters to the main method.
Note that due to the primary code unit in Nice is packet, the main method must be implemented outside of any class.