Search code examples
clojure

What is the meaning of # in front of Clojure symbol?


When I declare a global Var like:

(def x 100)

I get the following output -

=> #'tutorial.core/x

I can understand that the 'tutorial.core/x is a symbol here, but what is the meaning of #?


Solution

  • The "pound-quote" or #' is a reader macro. That is, it is shorthand for typing

    (var tutorial.core/x)
    

    or just

    (var x)   ; in the same namespace
    

    You can find more information here.