[Nice-commit] Nice NEWS,1.21,1.22
Brought to you by:
bonniot
From: <bo...@us...> - 2004-02-19 14:57:49
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8701 Modified Files: NEWS Log Message: Custom constructors, expression-local variables (explicitely typed version), typos. Index: NEWS =================================================================== RCS file: /cvsroot/nice/Nice/NEWS,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** NEWS 16 Feb 2004 23:09:15 -0000 1.21 --- NEWS 19 Feb 2004 14:47:19 -0000 1.22 *************** *** 1,15 **** nice (0.9.6) * Additional fields can be defined for enums and enums can implement ! interfaces, example: enum Coin(int value) implements Currency {penny(1), nickel(5), dime(10), quarter(25)} ! * Alternative syntax for calling methods that takes a closure with no ! arguments. For example 'loop(5) { doSomeThing(); }' is shorthand for ! 'loop(5, () => { doSomeThing(); });' * "using" statement, as in C#, defined in nice.lang using (!) the above syntax. ! * Stricter parsing of expression used as statement. ! * Improved performance of arrays used as lists. * New methods (in package nice.functional) for working with iterators and generators. --- 1,30 ---- nice (0.9.6) + * It is now possible to create custom constructors: + class Point { double x; double y; } + + new Point(double angle, double distance) + { + this(x: distance * cos(angle), y: distance * sin(angle)); + } + It is then possible to create a Point with either + new Point(x: ..., y: ...) or new Point(angle: ..., distance: ...). * Additional fields can be defined for enums and enums can implement ! interfaces, for instance: enum Coin(int value) implements Currency {penny(1), nickel(5), dime(10), quarter(25)} ! * Alternative syntax for calling methods that takes an anonymous function ! with no arguments. For example 'loop(5) { doSomeThing(); }' is a ! shorthand for 'loop(5, () => { doSomeThing(); });' * "using" statement, as in C#, defined in nice.lang using (!) the above syntax. ! * Expression-local variables: variables that are declared as the argument ! of a method call, and that are visible to the other arguments. ! A typical usage is, still using the above syntax: ! using(PrintStream s = ...) { ! s.println("..."); ! } ! * Stricter parsing of expressions used as statements. ! * Improved performance for arrays used as lists. * New methods (in package nice.functional) for working with iterators and generators. |