RosettaCodeData/Task/Loops-Foreach/Sather/loops-foreach.sa

11 lines
249 B
Plaintext

class MAIN is
main is
num:ARRAY{INT} := |1, 5, 4, 3, 10|;
loop
-- the iterator elt! behaves like a "foreach",
-- yielding the next element of the array at each iteration
#OUT + num.elt! + "\n";
end;
end;
end;