Answer till 4.27
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
((quoted? exp) (text-of-quotation exp))
|
||||
((assignment? exp) (eval-assignment exp env))
|
||||
((definition? exp) (eval-definition exp env))
|
||||
((unless? exp) (eval (unless->combination exp) env))
|
||||
((if? exp) (eval-if exp env))
|
||||
((lambda? exp)
|
||||
(make-procedure (lambda-parameters exp)
|
||||
@@ -108,6 +109,7 @@
|
||||
(define (make-lambda parameters body)
|
||||
(cons 'lambda (cons parameters body)))
|
||||
|
||||
(define (unless? exp) (tagged-list? exp 'unless))
|
||||
(define (if? exp) (tagged-list? exp 'if))
|
||||
(define (if-predicate exp) (cadr exp))
|
||||
(define (if-consequent exp) (caddr exp))
|
||||
@@ -244,8 +246,12 @@
|
||||
(list 'cons cons)
|
||||
(list 'null? null?)
|
||||
(list 'display display)
|
||||
(list 'equal? equal?)
|
||||
(list 'newline newline)
|
||||
(list '= =)
|
||||
(list '+ +)
|
||||
(list '* *)
|
||||
(list '/ /)
|
||||
(list '- -)
|
||||
(list '< <)
|
||||
;;<more primitives>
|
||||
@@ -299,6 +305,12 @@
|
||||
'<procedure-env>))
|
||||
(display object)))
|
||||
|
||||
(define (eval-verbose exp env)
|
||||
(let ((output (eval exp env)))
|
||||
(user-print output) (newline)
|
||||
output))
|
||||
|
||||
|
||||
(define the-global-environment (setup-environment))
|
||||
|
||||
;(driver-loop)
|
||||
|
||||
Reference in New Issue
Block a user