From 1e405cf0afd332eca326ea51fcd5aa90ed178ee7 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 4 Jun 1990 20:45:55 +0000 Subject: [PATCH] When loading a .scm file, fetch the repl environment and syntax table at the beginning of the load rather than for each expression in the file. This means that changing the repl environment or syntax table in the file will have no effect on the load. --- v7/src/runtime/load.scm | 28 ++++++++++++++++------------ v8/src/runtime/load.scm | 28 ++++++++++++++++------------ 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/v7/src/runtime/load.scm b/v7/src/runtime/load.scm index 80749070b..8f2905385 100644 --- a/v7/src/runtime/load.scm +++ b/v7/src/runtime/load.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/load.scm,v 14.14 1990/04/12 22:50:28 markf Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/load.scm,v 14.15 1990/06/04 20:45:55 cph Exp $ Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology @@ -244,17 +244,21 @@ MIT in each case. |# (define (eval-stream stream environment syntax-table) (stream-map stream - (lambda (s-expression) - (let ((repl (nearest-repl))) - (hook/repl-eval repl - s-expression - (if (eq? environment default-object) - (repl/environment repl) - environment) - (make-syntax-table - (if (eq? syntax-table default-object) - (repl/syntax-table repl) - syntax-table))))))) + (let ((repl (nearest-repl))) + (let ((environment + (if (eq? environment default-object) + (repl/environment repl) + environment)) + (syntax-table + (make-syntax-table + (if (eq? syntax-table default-object) + (repl/syntax-table repl) + syntax-table)))) + (lambda (s-expression) + (hook/repl-eval repl + s-expression + environment + syntax-table)))))) (define (write-stream stream write) (if (stream-pair? stream) diff --git a/v8/src/runtime/load.scm b/v8/src/runtime/load.scm index ad01823f4..7f3a34486 100644 --- a/v8/src/runtime/load.scm +++ b/v8/src/runtime/load.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/load.scm,v 14.14 1990/04/12 22:50:28 markf Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/load.scm,v 14.15 1990/06/04 20:45:55 cph Exp $ Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology @@ -244,17 +244,21 @@ MIT in each case. |# (define (eval-stream stream environment syntax-table) (stream-map stream - (lambda (s-expression) - (let ((repl (nearest-repl))) - (hook/repl-eval repl - s-expression - (if (eq? environment default-object) - (repl/environment repl) - environment) - (make-syntax-table - (if (eq? syntax-table default-object) - (repl/syntax-table repl) - syntax-table))))))) + (let ((repl (nearest-repl))) + (let ((environment + (if (eq? environment default-object) + (repl/environment repl) + environment)) + (syntax-table + (make-syntax-table + (if (eq? syntax-table default-object) + (repl/syntax-table repl) + syntax-table)))) + (lambda (s-expression) + (hook/repl-eval repl + s-expression + environment + syntax-table)))))) (define (write-stream stream write) (if (stream-pair? stream) -- 2.25.1