Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- i = 0
- f = Fiber.new do
- loop do
- Fiber.yield i
- i += 1
- end
- end
- e = Enumerator.produce {f.resume}
- p [0, 0, 0, 0].zip e # [[0, 0], [0, 1], [0, 2], [0, 3]]
- p [0, 0, 0, 0].zip e # [[0, 5], [0, 6], [0, 7], [0, 8]]
- # where does the 4 go?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement