I have a question regarding coroutines: are there plans to support coroutines and if - when will it happen?
With coroutines in combination with timers a very nice continuation-pattern like programming style would be possible.
Here is an example with wait, much more powerful things could be done with eg. input based triggers:
Code: Select all
function wait(co, t) tempTimer(t, [[coroutine.resume(co)]]) coroutine.yield(); end function myCo(me) for i=1,10 do wait(me, 5) echo("every 5 secs") end end co = coroutine.create(myCo) coroutine.resume(co, co)