The :: used for in clojure

clojure

I understand keywords in Clojure being :keyword. But what is the :: used for? Why does it look like it has a binding?

user=> :foo
:foo
user=> ::foo
:user/foo

Best Answer

The double colon is there to fully qualify keywords with your current namespace. This is intended to avoid name clashes for keywords which are meaningful for different libraries. Without fully qualified keywords you might accidentally overwrite some values in a map and break compatibility with a library.

Related Topic