<< Previous exercise (5.38) | Index | Next exercise (5.40) >>
;;my frame looks like this (define (make-frame variables values) (map list variables values)) (define (lexical-address-lookup address env) (let ((value (cadr (list-ref (list-ref env (car address)) (cadr address))))) (if (eq? value '*unassigned*) (error "Unassigned variable! -- LEXICAL-ADDRESS-LOOKUP" address) value))) (define (lexical-address-set! address env value) (let ((binding (list-ref (list-ref env (car address)) (cadr address)))) (set-cdr! binding value)))
meteorgan