array declaration

zekaonar

Member
I'm looks for the syntax to do

int[20] peterSkills = {1,1,1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,3, 2,2, 3, 2};

and I can't find a mention of it in docs, or examples.
 

Veracity

Developer
Staff member
I can't find a mention of it in docs, or examples.
ASH has no syntax for initializing a composite variable like that; the right-hand side of the equals has to evaluate to an "expression".

Arrays and records, at least, would be very useful. I can also imagine syntax for maps - multiple key/value pairs - although since you can have multi-dimensional maps - maps of maps of ... - that might end up getting obscure.

Parser.parseVariable() is the method that would need to be modified.

Feel free to make a Feature Request - but don't hold your breath waiting for it to be implemented. :)
 

Veracity

Developer
Staff member
Turns out this has been implemented now and you can use exactly the syntax which didn't used to work. ;)
 
Top