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>
33 lines
551 B
Scheme
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))))
|