From 36fb1e06c8aa56d5f62b9b86c23905b52fef7d41 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sun, 11 May 2008 20:53:47 +0200 Subject: [PATCH] fix to meta-reader's optional port argument * module/system/repl/repl.scm (meta-reader): Make the generated read procedure accept a port argument. --- module/system/repl/repl.scm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/module/system/repl/repl.scm b/module/system/repl/repl.scm index 2297fdbec..5142e58d1 100644 --- a/module/system/repl/repl.scm +++ b/module/system/repl/repl.scm @@ -32,10 +32,13 @@ (define meta-command-token (cons 'meta 'command)) (define (meta-reader read) - (lambda () - (if (eqv? (next-char #t) #\,) - (begin (read-char) meta-command-token) - (read)))) + (lambda read-args + (with-input-from-port + (if (pair? read-args) (car read-args) (current-input-port)) + (lambda () + (if (eqv? (next-char #t) #\,) + (begin (read-char) meta-command-token) + (read)))))) ;; repl-reader is a function defined in boot-9.scm, and is replaced by ;; something else if readline has been activated. much of this hoopla is