From b36640afda8d9b4e2a949e1fdc6e5ac147b07136 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Thu, 19 Mar 2015 13:23:11 -0400 Subject: [PATCH] Added tests from R7RS --- test.scm | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/test.scm b/test.scm index a634507f..c88871c3 100644 --- a/test.scm +++ b/test.scm @@ -23,8 +23,26 @@ ;(eval '(a 1)) ;(eval '(begin (define (a z) z) (a 1) (a 1))) -(Cyc-add-exception-handler (lambda (err) (write 'new-ex-handler))) -(Cyc-remove-exception-handler) +;(Cyc-add-exception-handler (lambda (err) (write 'new-ex-handler))) +;(Cyc-remove-exception-handler) +(write + (call/cc + (lambda (k) + (with-exception-handler + (lambda (x) + (display "condition: ") + (write x) + ;(newline) + (k 'exception)) + (lambda () + (+ 1 (raise 'an-error))))))) + +(with-exception-handler + (lambda (x) + (display "something went wrong\n")) + (lambda () + (+ 1 (raise 'an-error)))) + (define test '(a b)) (set-car! test '(1 2 3)) (write test)