Stubs for (raise-continuable)

This commit is contained in:
Justin Ethier 2015-03-19 14:07:22 -04:00
parent b36640afda
commit b55077ae1d
2 changed files with 17 additions and 2 deletions

View file

@ -23,8 +23,22 @@
;(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)
(write
(with-exception-handler
(lambda (con)
(cond
((string? con)
(display con))
(else
(display "a warning has been issued")))
42)
(lambda ()
(+ (raise-continuable "should be a number")
23))))
;prints: should be a number
;=> 65
(write
(call/cc
(lambda (k)

View file

@ -75,6 +75,7 @@
;; Unregister this handler since it is no longer needed
(Cyc-remove-exception-handler)
(handler obj) ;; Actual handler
;; TODO: unless obj is continuable, then return above result:
(error "exception handler returned"))))
;; TODO: cond-expand below, since it uses Cyc functions?
;; probably no need since this is part of internal lib