samth
2018-10-24 20:51:40

@mflatt we’re trying to figure out a precise specification for the behavior of raise. Unfortunately the “cs” implementation just defers to Chez. Is the following right (ignoring the barrier argument, which is handled as in src/cs/error.ss)? (define (raise v) (define h (continuation-mark-set-first #f exception-handler-key #f (default-continuation-prompt-tag))) (if h (h v) ((uncaught-exception-handler) v)))


samth
2018-10-24 20:52:04

Some things I’m not sure of in that code — the prompt tag, and the treatment when there’s no handler


mflatt
2018-10-24 22:52:56

No. Although RacketCS defers to Chez’s raise, Chez’s raise essentially just calls the base exception handler, and RacketCS sets that on line 736 of “http://error.ss\|error.ss”. So that’s where you want to look. You’ll see that there’s a loop to walk a list of handlers.


samth
2018-10-25 00:38:30

Thanks, that’s very helpful. What does indirecting Racket exceptions via Chez’s raise change, as opposed to just calling that directly?


mflatt
2018-10-25 00:55:16

Setting the base exception handler works right with exceptions that originate with Chez Scheme (e.g., car of null). And if the base exception handler is set, there’s no reason to avoid Chez Scheme’s raise.