Version 0.3.6
Friday, July 18, 2008 at 08:21AM Version 0.3.6 is now released. Numerous improvements:
static initializer blocks and static methods are now supported correctly. They work basically like in Java.
Array type literals are supported. They have an interesting syntax:
var a : [...int] = [1,2,3]; // a variable size array of integers
var b : [int, int, int] = [1,2,3]; //a fixed size array of three integers.
So the three dots mean "any number of". Fixed sized arrays can be heterogenous:
var c : [int, String, boolean] = [7, "hello", false];
And believe it or not, an array can even be a combination of heterogeneous types and variable size:
var d : [boolean, String, ...int] = [true, "hello", 1, 2, 3];
The first two items are boolean and String, end every item after is int.
Destructuring variable definitions is also supported now. This allows you to write:
var [a, b] = [1,2];
This is especially useful when returning arrays from a function, e.g.:
function f() { return [1, 2]; }
var [a,b] = f();
Olav |
Post a Comment | 
Reader Comments