what's wrong with my lua code? -
local consumer = coroutine.create(function(i) while true = - 1 print('consumer: ' .. i) coroutine.yield(i) end end) local producer = coroutine.create(function() while true = or 0 = + 1 print('producer: ' .. i) status, value = coroutine.resume(consumer, i) = value end end) coroutine.resume(producer)
but it's wrong, right print should this: 0 1 0 1 01
Comments
Post a Comment