From fa0cde8d77112bb269958f9fc13003ff2c0051bf Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Tue, 15 Jul 2014 23:09:20 +0900 Subject: [PATCH] publish call-with-{in,out}put-file --- piclib/built-in.scm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/piclib/built-in.scm b/piclib/built-in.scm index 36e2ab29..8221653e 100644 --- a/piclib/built-in.scm +++ b/piclib/built-in.scm @@ -1005,14 +1005,23 @@ (export call-with-port) +(define-library (scheme file) + (import (scheme base)) + + (define (call-with-input-file filename callback) + (call-with-port (open-input-file filename) callback)) + + (define (call-with-output-file filename callback) + (call-with-port (open-output-file filename) callback)) + + (export call-with-input-file + call-with-output-file)) + ;;; include syntax (import (scheme read) (scheme file)) -(define (call-with-input-file filename callback) - (call-with-port (open-input-file filename) callback)) - (define (read-many filename) (call-with-input-file filename (lambda (port)