Replace half-assed DYNAMIC-WIND protection of input port by the one
Richard Kelsey suggested for Scheme 48.
This commit is contained in:
parent
91002918fc
commit
69a2031350
|
@ -13,10 +13,11 @@
|
|||
(define (read-forms pathname package)
|
||||
(let* ((filename (namestring pathname #f *scheme-file-type*))
|
||||
(truename (translate filename))
|
||||
(port #f))
|
||||
(port (open-input-file truename)))
|
||||
(dynamic-wind
|
||||
(lambda ()
|
||||
(set! port (open-input-file truename)))
|
||||
(if (not port)
|
||||
(error "attempt to throw back into a file read"))) ; message needs work
|
||||
(lambda ()
|
||||
((fluid $note-file-package) filename package)
|
||||
(let ((o-port (current-noise-port)))
|
||||
|
@ -24,7 +25,8 @@
|
|||
(force-output o-port)
|
||||
(really-read-forms port)))
|
||||
(lambda ()
|
||||
(close-input-port port)))))
|
||||
(close-input-port port)
|
||||
(set! port #f)))))
|
||||
|
||||
(define (really-read-forms port)
|
||||
(let loop ((forms '()))
|
||||
|
|
Loading…
Reference in New Issue