Last active
January 19, 2016 20:28
-
-
Save mobius-eng/72a73f6bd49bf5041591 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define obj (make-top-level-environment)) | |
(environment-define obj 'foo (lambda (x) (+ x bar))) | |
(environment-define obj 'bar 10) | |
((environment-lookup obj 'foo) 1) | |
; Unbound variable: bar | |
;; This works: | |
(define obj (extend-top-level-environment #f)) | |
(eval '(define (foo x) (+ x bar)) obj) | |
(environment-define obj 'bar 10) | |
((environment-lookup obj 'foo) 1) | |
; 11 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment