make_fib_gen () -> fn () -> int32 { f1 := 0; f2 := 1; return fn () -> int32 { f2 = f2 + f1; f1 = f2 - f1; return f2; }; } f := make_fib_gen(); for (i := 0; i < 45; ++i) print f(); p := new array[int32](100); i := 0; while (i < 100) { for (j := 0; j < 100; ++j) p[i] = j; i++; } class Matrix { width: int32; height: int32; entries: array[int32]; constructor (width, height: int32) { entries = new array[int32] (width * height); this.width = width; this.height = height; for (i := 0; i < width * height; ++i) entries[i] = 0; } } class HashTable { typedef hash_func = fn (item: int32) -> uint32; typedef equal_func = fn (item1, item2: ref T)-> bool; hash: hash_func; equal: equal_func; entries: array [T]; constructor (hash: hash_func, equal: equal_func) { this.hash = hash; this.equal = equal; entries = new array[T] (256); } } class Map [Key, Value] { struct Item { key: Key; value: Value; }; table: Hashtable [Item]; constructor (hash: fn (ref Key) -> uint32, equal: fn (ref Key, ref Key)) { item_hash (i: ref Item) { return hash (i.key); } item_equal (i1, i2: ref Item) { return equal (i1.key, i2.key); } this.table = new HashTable[Item]; } } m := new Matrix (100, 100); m[10, 10] = 2300;