Last active
March 25, 2017 17:47
-
-
Save sw-samuraj/e42f3643290cb3408781f8fddb058a47 to your computer and use it in GitHub Desktop.
An example of Var referring from the other namespace.
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
;; the initial namespace in REPL is 'user' | |
(def my-var "var in the user namespace") | |
(ns new-namespace) | |
my-var | |
;; -> CompilerException java.lang.RuntimeException: | |
;; Unable to resolve symbol: my-var in this context | |
user/my-var | |
;; -> "var in the user namespace" | |
(refer 'user :only '[my-var]) | |
my-var | |
;; -> "var in the user namespace" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment