fork download
  1. fib = ->a, b {Enumerator.new {|y| loop {y << a; a, b = b, a + b}}}
  2. p fib.(0, 1).take(10)
Success #stdin #stdout 0s 28216KB
stdin
Standard input is empty
stdout
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]