Provide LOAD-PORT to load forms from a port.

This commit is contained in:
mainzelm 2003-03-13 07:49:49 +00:00
parent c936bcce29
commit 855cffa3c7
4 changed files with 9 additions and 19 deletions

View File

@ -23,12 +23,12 @@
(let ((o-port (current-noise-port)))
(display truename o-port)
(force-output o-port)
(really-read-forms port)))
(read-forms-from-port port)))
(lambda ()
(close-input-port port)
(set! port #f)))))
(define (really-read-forms port)
(define (read-forms-from-port port)
(let loop ((forms '()))
(let ((form (read port)))
(if (eof-object? form)

View File

@ -178,7 +178,7 @@
; Reading the forms in a file.
; This is used by scan-package and rts/eval.scm.
(define-structure reading-forms (export read-forms $note-file-package)
(define-structure reading-forms (export read-forms read-forms-from-port $note-file-package)
(open scheme-level-2
fluids filenames
signals ;error

View File

@ -1181,6 +1181,7 @@
(define-interface evaluation-interface
(export eval load load-into eval-from-file
load-port
; eval-scanned-forms
))

View File

@ -29,24 +29,13 @@
(interaction-environment)
(car package-option))))
(really-load-into filename package #t)))
; JMG For scsh.
(define (load-into-port port p)
(error "JMG: load into port called. See rts/eval"))
; (compile-and-run-port port p
; (lambda (template)
; (invoke-template template p))
; (current-noise-port)
; #t)); JMG whatever #t means...
(define (load-port port . package-option)
(error "JMG: load port called. See rts/eval "))
; (let ((p (if (null? package-option)
; (interaction-environment)
; (car package-option))))
; (noting-undefined-variables p
; (lambda ()
; (load-into-port port p)))))
(let ((package (if (null? package-option)
(interaction-environment)
(car package-option)))
(forms (read-forms-from-port port)))
(compile-and-run forms package #f #t)))
;----------------