pico8lisp
pico8lisp copied to clipboard
Error propagation in expressions
Errors need to bubble up in expressions.
(+ 1 'a) results in error not int a
(= 1 (+ 1 'a)) results in ().
Expected: error....
I think that = is getting.
(= 1 '(error ...)) which is a valid equality check.
PICO8 doesn't support throw, so we are returning errors not throwing.
Not sure what to do.
We could check for error lists in apply, and propagate there. But then it won't be easy to process errors.
We could add our own abstraction for function call/return and rely less on LUA.
We could change function semantics to return a (success, result) tuple. And treat non-success as a throw.