From 0a7a3a8266029a4a461074b431a1325df63070b9 Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Sun, 28 Sep 2008 00:08:34 -0400 Subject: [PATCH] made load feel like a top-level by consuming the contents of the given file one expression at a time. Most notable difference is observed when the loaded file captures a conitnuation in one expression. Re-invoking this continuation should evaluate the next expression that has not been evaluated yet, and not the expression following the call/cc. --- scheme/ikarus.load.ss | 8 +++++++- scheme/last-revision | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/scheme/ikarus.load.ss b/scheme/ikarus.load.ss index b328200..673f760 100644 --- a/scheme/ikarus.load.ss +++ b/scheme/ikarus.load.ss @@ -81,7 +81,13 @@ (die 'load "not a string" x)) (unless (procedure? eval-proc) (die 'load "not a procedure" eval-proc)) - (for-each eval-proc (read-script-source-file x))])) + (let ([ls (read-script-source-file x)]) + (let f () + (unless (null? ls) + (let ([a (car ls)]) + (set! ls (cdr ls)) + (eval-proc a)) + (f))))])) (define load-r6rs-top-level (lambda (x how) (let ([prog (read-script-source-file x)]) diff --git a/scheme/last-revision b/scheme/last-revision index eff9e16..f800fc8 100644 --- a/scheme/last-revision +++ b/scheme/last-revision @@ -1 +1 @@ -1616 +1617