|
|
|
|
|
by hencq
76 days ago
|
|
Very cool stuff and great written article. Lone looks very interesting! Are you planning to use your design to support things like exceptions as well? I think that's where that multi-prompt ability becomes important (yielding from a nested coroutine). Racket has prompts and aborts, which is essentially a 'yield to' primitive. |
|
My delimited continuations article also talks about exception handling:
https://www.matheusmoreira.com/articles/delimited-continuati...
Throw/catch are just delimited continuations which don't actually capture the continuation. The machinery is already in place. If I copied the control/transfer primitives and removed the continuation code, I'd have a functional exceptions handling mechanism.
In suppose I can use tagged prompts to catch some exceptions and not others. Place a symbol in the stack delimiter, then the transfer primitive can look for it and skip anything that doesn't match. Untagged prompts just use nil as the tag.