Project

General

Profile

Bug #7212 ยป recursive.rb

fiddur (Fredrik Liljegren), 10/24/2012 11:21 PM

 
def recursive(level = 0)
-> do
p "In block #{level}"
if level < 1000
subblock = recursive(level + 1)
subblock.call
end
end
end

p "Doing recursive call in a fiber"
Fiber.new { recursive.call }.resume
    (1-1/1)