In READ-FORMS, open/close input port in DYNAMIC-WIND before/after
thunks.
This commit is contained in:
parent
196efa4e85
commit
4c90a345ec
|
@ -12,14 +12,19 @@
|
||||||
|
|
||||||
(define (read-forms pathname package)
|
(define (read-forms pathname package)
|
||||||
(let* ((filename (namestring pathname #f *scheme-file-type*))
|
(let* ((filename (namestring pathname #f *scheme-file-type*))
|
||||||
(truename (translate filename)))
|
(truename (translate filename))
|
||||||
(call-with-input-file truename
|
(port #f))
|
||||||
(lambda (port)
|
(dynamic-wind
|
||||||
((fluid $note-file-package) filename package)
|
(lambda ()
|
||||||
(let ((o-port (current-noise-port)))
|
(set! port (open-input-file truename)))
|
||||||
(display truename o-port)
|
(lambda ()
|
||||||
(force-output o-port)
|
((fluid $note-file-package) filename package)
|
||||||
(really-read-forms port))))))
|
(let ((o-port (current-noise-port)))
|
||||||
|
(display truename o-port)
|
||||||
|
(force-output o-port)
|
||||||
|
(really-read-forms port)))
|
||||||
|
(lambda ()
|
||||||
|
(close-input-port port)))))
|
||||||
|
|
||||||
(define (really-read-forms port)
|
(define (really-read-forms port)
|
||||||
(let loop ((forms '()))
|
(let loop ((forms '()))
|
||||||
|
|
Loading…
Reference in New Issue