picrin/t/exception.scm

12 lines
214 B
Scheme
Raw Normal View History

2013-11-17 03:25:26 -05:00
(write
(call/cc
(lambda (k)
(with-exception-handler
(lambda (x)
(write "condition: ")
(write x)
(newline)
(k 'exception))
(lambda ()
(+ 1 (raise 'an-error)))))))