Implement 5.49
This commit is contained in:
@@ -61,6 +61,7 @@
|
||||
(define (compile-and-run? expression)
|
||||
(tagged-list? expression 'compile-and-run))
|
||||
(define (compile-and-run expression)
|
||||
(display expression) (newline)
|
||||
(let ((instructions
|
||||
(assemble (statements
|
||||
(compile (cadr expression) 'val 'return))
|
||||
@@ -160,9 +161,10 @@ read-eval-print-loop
|
||||
(perform (op initialize-stack))
|
||||
(perform
|
||||
(op prompt-for-input) (const ";;; EC-Eval input:"))
|
||||
(assign exp (op read))
|
||||
(assign env (op get-global-environment))
|
||||
(assign continue (label print-result))
|
||||
(assign exp (op read))
|
||||
; (assign exp (op list) (const compile-and-run) (reg exp)) ;; read-compile-execute - ex-5.49
|
||||
(goto (label eval-dispatch))
|
||||
print-result
|
||||
;;**following instruction optional -- if use it, need monitored stack
|
||||
|
||||
Reference in New Issue
Block a user