ジェネレータ

def fib_make()
  a, b = 1, 1

  return lambda {
    t = a
    a, b = b, a + b
    return t
  }
end

fib1 = fib_make()
fib2 = fib_make()

10.times {
  puts fib1[]
}

10.times {
 puts fib2[]
}