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?
P#65592 2019-07-05 09:33 ( Edited 2019-07-05 09:34)
1
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.
P#65593 2019-07-05 10:04 ( Edited 2019-07-05 10:06)
[Please log in to post a comment]