[plt-scheme] restart exception handling?
Hi -
Is it possible to handle exceptions like Common Lisp, specifically
restarts?
Scenario: undefined variables - handling by defining the variable, and
continue past the exception.
It's unclear to me how to write the following code - I assume it requires
continuations and continuation-marks in the exception, but I know very
little about the topic...
;; x is undefined - provide it with #<undefined> and continue
(with-handlers ((exn:fail:contract:variable?
(lambda (e)
(*use-value* (letrec ((x x)) x)))) ;; supply x with the
value of undefined
(eval `(display x)))
;; prints #<undefined>
I found in manual that exceptions are marked with barriers and may not be
crossable, so not sure if the above is achievable.
Any pointers are appreciated, thanks,
yc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20080710/7e8358a9/attachment.html>