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.




var f = Fn.new { |g, n|
    for (i in 1..n) g.call(n)
}
 
var g = Fn.new { |k|
    for (i in 1..k) System.write("%(i) ")
    System.print()
}
 
f.call(g, 5)