lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>The thing is, when reverting to doModeA after calling doModeB, I want
>modeA.execute() to restart from the beginning, and output "modeA" instead of
>"sequence 4"

Perhaps I'm missing a lot here, but in Lua 5.0 you can send "messages"
(that is, Lua values) in resume and receive them in yield. You can use
those messages to tell the taks to restart itself or to stop or anything
else. I guess this means that tasks that need to restart themselves
run inside their own infinite loop. Wouldn't that work for you? Do you
really need taks to restart themselves inside the Lua VM?
--lhf