RosettaCodeData/Task/Arrays/Sather/arrays.sa
Ingy döt Net 80737d5a6a new tasks
2013-04-09 00:46:50 -07:00

12 lines
381 B
Text

-- a is an array of INTs
a :ARRAY{INT};
-- create an array of five "void" elements
a := #ARRAY{INT}(5);
-- static creation of an array with three elements
b :ARRAY{FLT} := |1.2, 1.3, 1.4|;
-- accessing an array element
c ::= b[0]; -- syntactic sugar for b.aget(0)
-- set an array element
b[1] := c; -- syntactic sugar for b.aset(1, c)
-- append another array
b := b.append(|5.5|);