Skip to content

Instantly share code, notes, and snippets.

@sw-samuraj
Last active March 25, 2017 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sw-samuraj/e42f3643290cb3408781f8fddb058a47 to your computer and use it in GitHub Desktop.
Save sw-samuraj/e42f3643290cb3408781f8fddb058a47 to your computer and use it in GitHub Desktop.
An example of Var referring from the other namespace.
;; 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