Files
picrin/t/exception.scm
T
OGINO Masanori ebda32d108 Add (import ...) to etc/tak.scm and t/*.scm.
Note that this commit only fixes 'unbound variable' errors. For now
t/dynamic-wind.scm, t/exception.scm and t/ir-macro.scm seem buggy on my
Linux (amd64) machine.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-01-05 16:11:32 +09:00

33 lines
551 B
Scheme

(import (scheme base)
(scheme write))
(define (print obj)
(write obj)
(newline)
obj)
(print
(call/cc
(lambda (k)
(with-exception-handler
(lambda (x)
(write "condition: ")
(write x)
(newline)
(k 'exception))
(lambda ()
(+ 1 (raise 'an-error)))))))
(print
(with-exception-handler
(lambda (con)
(cond
((string? con)
(print con))
(else
(print "a warning has been issued")))
42)
(lambda ()
(+ (raise-continuable "should be a number")
23))))