RosettaCodeData/Task/Repeat/Chapel/repeat-3.chpl
2026-04-30 12:34:36 -04:00

13 lines
178 B
Chapel

config const n = 5;
proc example(x : uint)
{
writeln("example ", x);
}
proc repeat(func : proc(x : uint), n : uint)
{
for i in 0..#n do func(i);
}
repeat(example, n);