Project

General

Profile

Bug #17814 » test.rb

dzwdz (Kuba Prawdziwe-Nazwisko), 04/19/2021 03:00 PM

 
#!/usr/bin/env ruby

i = 0
f = Fiber.new do
loop do
p i
Fiber.yield i
i += 1
end
end

e = Enumerator.produce {f.resume}

p [0, 0, 0, 0].zip e
p [0, 0, 0, 0].zip e

p [0, 0, 0, 0].each.zip e
p [0, 0, 0, 0].each.zip e
(1-1/2)