#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/input.scm,v 14.14 1991/11/26 07:06:21 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/input.scm,v 14.15 1992/05/26 23:08:41 mhwu Exp $
Copyright (c) 1988-91 Massachusetts Institute of Technology
(guarantee-input-port port)
(fluid-let ((*current-input-port* port)) (thunk)))
-(define (call-with-input-file input-specifier receiver)
- (let ((port (open-input-file input-specifier)))
+(define ((make-call-with-input-file open) input-specifier receiver)
+ (let ((port (open input-specifier)))
(let ((value (receiver port)))
(close-port port)
value)))
-(define (with-input-from-file input-specifier thunk)
- (call-with-input-file input-specifier
+(define call-with-input-file
+ (make-call-with-input-file open-input-file))
+
+(define call-with-binary-input-file
+ (make-call-with-input-file open-binary-input-file))
+
+(define ((make-with-input-from-file call) input-specifier thunk)
+ (call input-specifier
(lambda (port)
(fluid-let ((*current-input-port* port))
(thunk)))))
+
+(define with-input-from-file
+ (make-with-input-from-file call-with-input-file))
+
+(define with-input-from-binary-file
+ (make-with-input-from-file call-with-binary-input-file))
\f
;;;; Input Procedures
#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/output.scm,v 14.12 1991/11/26 07:06:35 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/output.scm,v 14.13 1992/05/26 23:08:56 mhwu Exp $
Copyright (c) 1988-91 Massachusetts Institute of Technology
(guarantee-output-port port)
(fluid-let ((*current-output-port* port)) (thunk)))
-(define (call-with-output-file output-specifier receiver)
+(define ((make-call-with-output-file open) output-specifier receiver)
(let ((port (open-output-file output-specifier)))
(let ((value (receiver port)))
(close-port port)
value)))
-(define (with-output-to-file output-specifier thunk)
- (call-with-output-file output-specifier
+(define call-with-output-file
+ (make-call-with-output-file open-output-file))
+
+(define call-with-binary-output-file
+ (make-call-with-output-file open-binary-output-file))
+
+(define ((make-with-output-to-file call) output-specifier thunk)
+ (call output-specifier
(lambda (port)
(fluid-let ((*current-output-port* port))
(thunk)))))
+
+(define with-output-to-file
+ (make-with-output-to-file call-with-output-file))
+
+(define with-output-to-binary-file
+ (make-with-output-to-file call-with-binary-output-file))
\f
;;;; Output Procedures