(define (lookup-variable-value var env)
(if (eq? env the-empty-environment)
- (error "unbound variable:" var)
+ (error "unbound variable: " var)
(let ([frame (first-frame env)])
(let ([value (hash-ref frame var (lambda () (lookup-variable-value var (enclosing-environment env))))])
(if (eq? value '*unassigned*)
(define (set-variable-value! var val env)
(if (eq? env the-empty-environment)
- (error "unbound variable")
+ (error "unbound variable: " var)
(let ([frame (first-frame env)])
(if (hash-has-key? frame var)
(hash-set! frame var val)
(list '- -)
(list '* *)
(list '/ /)
- (list '= =)))
+ (list '= =)
+ (list '> >)
+ (list '< <)))
(define (primitive-procedure-names)
(map car primitive-procedures))
(primitive-implementation proc) args))
;; global env
-(define (setup-environment)
+(define (make-environment)
(let ((initial-env
(extend-environment (primitive-procedure-names)
(primitive-procedure-objects)
(define-variable! 'false false initial-env)
initial-env))
-(define the-global-environment (setup-environment))
+(define the-global-environment (make-environment))
;; application
(define (list-of-values exps env)