Re: [racket-users] resumable exceptions (or: How can I break myself?)

2020-12-29 Thread je...@lisp.sh
Using parameters is a helpful suggestion. In my case, it's enough to just record the error and add a substitution character (explicitly marked as induced, that is, wasn't actually present in the input) without needing to rewind or advance the input port. It's sufficient for my purposes to just

Re: [racket-users] resumable exceptions (or: How can I break myself?)

2020-12-29 Thread Ryan Culpepper
I would suggest avoiding exceptions and continuations and have a separate parameter[*] that holds the current unexpected character handler. You'll still have to figure out what kind of thing it returns (void, or a replacement character, or a new input port?), but you have to do that anyway. The

[racket-users] resumable exceptions (or: How can I break myself?)

2020-12-29 Thread je...@lisp.sh
I'm working on a tokenizer for that involves some level of "self-healing": if the input port contains an unexpected character, an error token is to be emitted, but computation isn't over -- we are to continue by substituting the bad character with a good one, emitting that, too (thereby