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

13 lines
157 B
Chapel

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