mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-18 21:29:18 +02:00
Attempting to use exception handling, but running into trouble
This commit is contained in:
parent
41c458c23f
commit
15094f6d03
1 changed files with 13 additions and 2 deletions
15
icyc.scm
15
icyc.scm
|
@ -8,12 +8,23 @@
|
|||
(cyclone
|
||||
(display *Cyc-version-banner*))
|
||||
(else #f))
|
||||
|
||||
;; TODO: define repl iteration, and wrap in an exception handler
|
||||
|
||||
(define (repl:next-line)
|
||||
(with-exception-handler
|
||||
(lambda (obj)
|
||||
(write (list 'an-error-occurred obj)))
|
||||
(lambda ()
|
||||
(repl))))
|
||||
|
||||
(define (repl)
|
||||
(display "cyclone> ")
|
||||
(let ((c (eval (read))))
|
||||
(cond
|
||||
((not (eof-object? c))
|
||||
(write c)
|
||||
(repl))
|
||||
(repl:next-line))
|
||||
(else #f))))
|
||||
(repl)
|
||||
|
||||
(repl:next-line)
|
||||
|
|
Loading…
Add table
Reference in a new issue