mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-04 11:46:37 +02:00
closing port immediately on return with-{input-from,output-to}-file
This commit is contained in:
parent
f895ace01b
commit
6adeccf173
1 changed files with 2 additions and 2 deletions
|
@ -583,7 +583,7 @@
|
|||
(tmp-in (open-input-file file)))
|
||||
(dynamic-wind
|
||||
(lambda () (current-input-port tmp-in))
|
||||
thunk
|
||||
(lambda () (let ((res (thunk))) (close-input-port tmp-in) res))
|
||||
(lambda () (current-input-port old-in)))))
|
||||
|
||||
(define (with-output-to-file file thunk)
|
||||
|
@ -591,7 +591,7 @@
|
|||
(tmp-out (open-output-file file)))
|
||||
(dynamic-wind
|
||||
(lambda () (current-output-port tmp-out))
|
||||
thunk
|
||||
(lambda () (let ((res (thunk))) (close-output-port tmp-out) res))
|
||||
(lambda () (current-output-port old-out)))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
Loading…
Add table
Reference in a new issue