Task

Write a procedure which accepts as arguments another procedure and a positive integer.

The latter procedure is executed a number of times equal to the accepted integer.




def unoptimized_repeat(f; n):
  if n <= 0 then empty
  else f, repeat(f; n-1)
  end;