* added an "eval-top-level" procedure.

This commit is contained in:
Abdulaziz Ghuloum 2007-05-03 01:18:59 -04:00
parent 86a75e8d54
commit 2632c786ec
5 changed files with 12 additions and 5 deletions

Binary file not shown.

View File

@ -99,8 +99,7 @@ description:
(define default-cafe-eval
(lambda (x)
(chi-top-library x)
(void)))
(chi-top-library x)))
(primitive-set! 'new-cafe
(case-lambda

View File

@ -410,6 +410,7 @@
[command-line-arguments command-line-arguments-label (core-prim . command-line-arguments)]
[list*->code* list*->code*-label (core-prim . list*->code*)]
[install-library install-library-label (core-prim . install-library)]
[eval-top-level eval-top-level-label (core-prim . eval-top-level)]
;;; record/mid-level
[record? record?-label (core-prim . record?)]
[make-record-type make-record-type-label (core-prim . make-record-type)]

View File

@ -1575,6 +1575,13 @@
[(core-macro)
(let ([transformer (core-macro-transformer value)])
(transformer e r mr))]
[(global)
(let* ([loc value]
[lib (imported-loc->library loc)])
(unless lib
(syntax-error e "BUG: cannot find defining library"))
((run-collector) lib)
(build-global-reference no-source loc))]
[(core-prim)
(let ([name value])
(build-primref no-source name))]
@ -2068,7 +2075,8 @@
(strip x '()))))
(primitive-set! 'syntax-dispatch syntax-dispatch)
(primitive-set! 'boot-library-expand boot-library-expander)
(primitive-set! 'chi-top-library run-library-expander))
(primitive-set! 'chi-top-library run-library-expander)
(primitive-set! 'eval-top-level run-library-expander))

View File

@ -791,8 +791,7 @@
(let ()
(define load-handler
(lambda (x)
(chi-top-library x)
(void)))
(chi-top-library x)))
(define read-and-eval
(lambda (p eval-proc)
(let ([x (my-read p)])