add call-with-port

This commit is contained in:
Yuichi Nishiwaki
2013-12-10 05:53:59 -08:00
parent cdb1911f9f
commit c67c81c1aa
+8
View File
@@ -745,3 +745,11 @@
(apply f (vector-ref v n)
(map (lambda (v) (vector-ref v n)) vs))
(loop (+ n 1))))))
;;; 6.13. Input and output
(define (call-with-port port proc)
(dynamic-wind
(lambda () #f)
(lambda () (proc port))
(lambda () (close-port port))))