Created
November 4, 2014 17:43
-
-
Save semperos/5d2e8fdd3ad87087b793 to your computer and use it in GitHub Desktop.
Var's in fn's
This file contains hidden or 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
| #_user=> (defn init [] (def foo 42) (def bar 21)) | |
| ;=> #'user/init | |
| #_user=> (ns new-ns (:require user)) | |
| ;=> nil | |
| #_new-ns=> (user/init) | |
| ;=> #'user/bar | |
| #_new-ns=> foo | |
| ; CompilerException java.lang.RuntimeException: Unable to resolve symbol: foo in this context, compiling:(/private/var/folders/nv/qqtdn92n2hzb30fp95xytks80000gp/T/form-init2636843255245152689.clj:1:4154) | |
| #_new-ns=> bar | |
| ; CompilerException java.lang.RuntimeException: Unable to resolve symbol: bar in this context, compiling:(/private/var/folders/nv/qqtdn92n2hzb30fp95xytks80000gp/T/form-init2636843255245152689.clj:1:4154) | |
| #_new-ns=> user/foo | |
| ;=> 42 | |
| #_new-ns=> user/bar | |
| ;=> 21 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment