I am currently working on converting some old scripts and I have come across a curiosity.
In one of them there is an array declared as follows:
var thingarray:=(len(stuff));
Note the parenthesis rather than braces. I was just curious if this is legal? eCompile seems to accept it just fine but I have always seen arrays defined with braces.
Array declaration construct question.
Both methods work, but using braces is the preferred method and parenthesis are only there for backwards compatibility. It was changed with POL95.
From core-changes.txt:
From core-changes.txt:
Code: Select all
06-12 Syzygy
escript changes:
Added (yet another) syntax for declaring initialized arrays:
var x := array { 4, 3, 2 };
this is more consistent with struct { x, y, z } initializer syntax.
array(8,3,2) looks too much like it's creating a multi-dimensional array, so I don't like it anymore.In the distro we do this:
Code: Select all
var array := array{1, 2, 3};-
Barbeirosa