⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (228 Bytes)
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)
Loading...