/// documentation comment /** another documentation comment */ //commented out code highlighted differently /* more commented out code */ ///a function that takes and returns a type: my_array(value_type : type) { return table{ i: int; data: value_type; /// @i refers to i in general in current context, rather than value of some specific i . /// @ is not really necessary and i'm uncediced if i will requir it pkey = @i; sparse = false;/// we want no holes } } my_2d_array(value_type : type) { return table{ i: int; j: int; line: value_type; pkey = @i, @j; /// primary key sparse = false; } } a : my_array(string); b : my_2d_array(double); b[0..9, 0..9]=0.0; /// reserve 10x10 , initialized with zero /// or reserve 10x10 table, unitialized //b[0..9, 0..9]=unitialized; /// or just reserve like std::vector.reserve in c++ //b.reserve(0..9, 0..9) /// hmm, alternative mathematical syntax, where ) is open and [ is closed ? would drive people nuts tho. //b.[[0,10),[0,10)]=0.0; ///syntactic shugar for primary key: /// a[keys] returns a table row and can be converted to tuple containing all non-key elements in table row a[0]="hello world";/// = can create element, will resize array to fit. a[0]:="this is ok";/// := can only assign b[1,1]=7; /// getting from table element to table index: dbgprint b[1,2].i;///prints 1 dbgprint b[1,2].j;///prints 2 ///loops: for(element in b){ element.data:=element.i*0.1+element.j*0.01; } ///or alternatively much cleverer but far more annoying syntax for such stuff, i probably wont do that: x,y: all in{ b[x,y]:=x*0.1+y*0.01;/// for all x and all y for which the expression is valid. If that would be = world would blow up... } a[1]:="bye bye" /// error on compile time or runtime coz a[1] doesnt exist and := is forbidden .