* moved load to ikarus.load.ss
This commit is contained in:
parent
cbad0231d4
commit
e3c58d4464
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -0,0 +1,30 @@
|
|||
|
||||
(library (ikarus load)
|
||||
(export load)
|
||||
(import
|
||||
(except (ikarus) load)
|
||||
(only (ikarus reader) read-initial))
|
||||
|
||||
(define load-handler
|
||||
(lambda (x)
|
||||
(eval-top-level x)))
|
||||
(define read-and-eval
|
||||
(lambda (p eval-proc)
|
||||
(let ([x (read p)])
|
||||
(unless (eof-object? x)
|
||||
(eval-proc x)
|
||||
(read-and-eval p eval-proc)))))
|
||||
(define load
|
||||
(case-lambda
|
||||
[(x) (load x load-handler)]
|
||||
[(x eval-proc)
|
||||
(unless (string? x)
|
||||
(error 'load "~s is not a string" x))
|
||||
(unless (procedure? eval-proc)
|
||||
(error 'load "~s is not a procedure" eval-proc))
|
||||
(let ([p (open-input-file x)])
|
||||
(let ([x (read-initial p)])
|
||||
(unless (eof-object? x)
|
||||
(eval-proc x)
|
||||
(read-and-eval p eval-proc)))
|
||||
(close-input-port p))])))
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
(library (ikarus reader)
|
||||
(export read read-token comment-handler load)
|
||||
(export read read-initial read-token comment-handler)
|
||||
(import
|
||||
(ikarus system $chars)
|
||||
(except (ikarus) read read-token comment-handler load))
|
||||
(except (ikarus) read read-token comment-handler))
|
||||
|
||||
(define delimiter?
|
||||
(lambda (c)
|
||||
|
@ -785,29 +785,5 @@
|
|||
(error 'comment-handler "~s is not a procedure" x))
|
||||
x)))
|
||||
|
||||
(module (load)
|
||||
(define load-handler
|
||||
(lambda (x)
|
||||
(eval-top-level x)))
|
||||
(define read-and-eval
|
||||
(lambda (p eval-proc)
|
||||
(let ([x (my-read p)])
|
||||
(unless (eof-object? x)
|
||||
(eval-proc x)
|
||||
(read-and-eval p eval-proc)))))
|
||||
(define load
|
||||
(case-lambda
|
||||
[(x) (load x load-handler)]
|
||||
[(x eval-proc)
|
||||
(unless (string? x)
|
||||
(error 'load "~s is not a string" x))
|
||||
(unless (procedure? eval-proc)
|
||||
(error 'load "~s is not a procedure" eval-proc))
|
||||
(let ([p (open-input-file x)])
|
||||
(let ([x (read-initial p)])
|
||||
(unless (eof-object? x)
|
||||
(eval-proc x)
|
||||
(read-and-eval p eval-proc)))
|
||||
(close-input-port p))])))
|
||||
)
|
||||
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
"ikarus.compiler.ss"
|
||||
"ikarus.library-manager.ss"
|
||||
"ikarus.syntax.ss"
|
||||
"ikarus.load.ss"
|
||||
"ikarus.pretty-print.ss"
|
||||
"ikarus.cafe.ss"
|
||||
"ikarus.posix.ss"
|
||||
|
|
Loading…
Reference in New Issue