RosettaCodeData/Task/Loops-Foreach/Sather/loops-foreach.sa
2023-07-01 13:44:08 -04:00

10 lines
249 B
Text

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;