Make compile and go work and answer 5.45
This commit is contained in:
20
shared/sicp-load-eceval-compiler.scm
Normal file
20
shared/sicp-load-eceval-compiler.scm
Normal file
@@ -0,0 +1,20 @@
|
||||
;;;; LOADS THE EXPLICIT-CONTROL EVALUATOR FROM SECTION 5.4 OF
|
||||
;;;; STRUCTURE AND INTERPRETATION OF COMPUTER PROGRAMS, WITH
|
||||
;;;; ALL THE SUPPORTING CODE IT NEEDS IN ORDER TO RUN.
|
||||
|
||||
;;;;This is like load-eceval.scm except that it loads the version
|
||||
;;;; of eceval that interfaces with compiled code
|
||||
;;;;It doesn't load the compiler itself -- loading the compiler is up to you.
|
||||
|
||||
;;;; **NB** The actual "load" calls are implementation dependent.
|
||||
|
||||
(load "shared/sicp-regsim") ;reg machine simulator
|
||||
|
||||
;; **NB** next file contains another "load"
|
||||
(load "shared/sicp-eceval-support") ;simulation of machine operations
|
||||
|
||||
;;**NB** eceval-compiler *must* be loaded after eceval-support,
|
||||
;; so that the version of user-print in eceval-compiler will override
|
||||
;; the version in eceval-support
|
||||
(load "shared/sicp-eceval-compiler") ;eceval itself
|
||||
;and interface to compiled code
|
||||
@@ -291,7 +291,7 @@
|
||||
((eq? (car inst) 'restore)
|
||||
(make-restore inst machine stack pc))
|
||||
((eq? (car inst) 'label)
|
||||
(make-label pc))
|
||||
(make-pseudo-label pc))
|
||||
((eq? (car inst) 'perform)
|
||||
(make-perform inst machine labels ops pc))
|
||||
((eq? (car inst) 'inc)
|
||||
@@ -299,7 +299,7 @@
|
||||
(else (error "Unknown instruction type -- ASSEMBLE"
|
||||
inst))))
|
||||
|
||||
(define (make-label pc)
|
||||
(define (make-pseudo-label pc)
|
||||
(lambda () (advance-pc pc)))
|
||||
|
||||
(define (make-assign inst machine labels operations pc)
|
||||
|
||||
Reference in New Issue
Block a user