I'm loving coroutines -- they make it so easy to write complex animations and user interactions. But without error stacktraces, debugging them is a nightmare. What's the plan around this? Can we expect a new version of Pico-8 with better error reporting from coroutines?
Not perfect but you can use that pattern:
— f is the coroutine handler local cs=costatus(f) if cs=="suspended" then assert(coresume(f)) elseif cs=="dead" then — dispose coroutine end
Trick is to wrap coroutine exec with an assert.
Gives a stack trace in case of error.
[Please log in to post a comment]