(quote a)
returns a symbol (clojure.lang.Symbol) - it effectively does the same as 'a
. It's worth reading a bit more about the Clojure reader to find out a bit more about symbols. Example:
(quote a)
=> a
(var a)
returns the var (clojure.lang.Var) represented by the symbol a in the current namespace. You'll get an error if a is not defined in the current namespace. Example:
(var a)
=> #<CompilerException java.lang.RuntimeException: Unable to resolve var: a in this context, compiling:(NO_SOURCE_PATH:1)>
(def a 1)
(var a)
=> #'user/a
That's the technical definition - but here's the intuition behind it: a symbol is a name, which can be used to look up a var in a given namespace. A var itself is a kind of reference that can hold any kind of Clojure value. So a symbol identifies a var which contains a value.
quote
as well. It ought to make sense. – user166390