lbForth
lbForth copied to clipboard
Exceptions don't work well with the SEARCH wordset
When an exception is thrown, one wordlist is dropped from the search order.
Test case:
include search.fth
also forth order \ "forth forth only"
abort
order \ "forth only"
This is due to an uncaught THROW. No clean solution yet here... need to have a catchall CATCH in the outer loop and fix up some other pieces.
Thanks. It's actually because [ and ] calls PREVIOUS and ALSO. The intent is that ] adds compiler-words to the search order, and [ removes it. And ABORT calls [ to enter interpret mode.
Without search.fth loaded PREVIOUS and ALSO are no-ops. But when loaded, those words are redefined to use the search order stack. And it becomes unbalanced when ABORT is called.