From: Chris Hanson Date: Mon, 6 Mar 1989 19:57:44 +0000 (+0000) Subject: Add new operation `set-current-input-port!'. X-Git-Tag: 20090517-FFI~12253 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=460ed6dae37e98ed2f572f8d17b373e48d2aa291;p=mit-scheme.git Add new operation `set-current-input-port!'. --- diff --git a/v7/src/runtime/input.scm b/v7/src/runtime/input.scm index 9276831eb..d5ae5f4c1 100644 --- a/v7/src/runtime/input.scm +++ b/v7/src/runtime/input.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/input.scm,v 14.3 1988/07/14 07:40:08 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/input.scm,v 14.4 1989/03/06 19:57:44 cph Rel $ -Copyright (c) 1988 Massachusetts Institute of Technology +Copyright (c) 1988, 1989 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -207,10 +207,14 @@ MIT in each case. |# (define-integrable (current-input-port) *current-input-port*) +(define (set-current-input-port! port) + (guarantee-input-port port) + (set! *current-input-port* port) + unspecific) + (define (with-input-from-port port thunk) - (if (not (input-port? port)) (error "Bad input port" port)) - (fluid-let ((*current-input-port* port)) - (thunk))) + (guarantee-input-port port) + (fluid-let ((*current-input-port* port)) (thunk))) (define (with-input-from-file input-specifier thunk) (let ((new-port (open-input-file input-specifier))