In R⁶RS Standard Library Section 7.1, guard is specified as follows:
If every ⟨cond clause⟩’s ⟨test⟩ evaluates to #f and there is no else clause, then raise-continuable is re-invoked on the raised object within the dynamic environment of the original call to raise except that the current exception handler is that of the guard expression. [emphasis mine]
This means in the program
#!r6rs
(import (rnrs))
(guard (con [#f #f])
(dynamic-wind
(lambda ()
(display "entered")
(newline))
(lambda ()
(raise (condition
(make-message-condition "condition"))))
(lambda ()
(display "exited")
(newline))))
re-raising should be within the dynamic-wind. However, Racket outputs
entered
exited
condition
context...:
/path/to/r6rs-lib/r6rs/private/conds.rkt:53:0: condition
/path/to/test.ss:9:4
body of "/path/to/test.ss"
which indicates that the dynamic-wind was only exited once. In comparison, Chez Scheme outputs
entered
exited
entered
Exception: condition
exited
In R⁶RS Standard Library Section 7.1,
guardis specified as follows:This means in the program
re-raising should be within the
dynamic-wind. However, Racket outputswhich indicates that the
dynamic-windwas only exited once. In comparison, Chez Scheme outputs