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.
This commit is contained in:
Abdulaziz Ghuloum 2008-09-28 00:08:34 -04:00
parent 90175f528f
commit 0a7a3a8266
2 changed files with 8 additions and 2 deletions

View File

@ -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)])

View File

@ -1 +1 @@
1616
1617