If you are like us, you use clojurescript namespaces for a while, but without really understanding how it works under the hoods.
(ns my-project.my-ns) (def x 1) (def y 2)
The clojurescript compiler translates the variables of the clojurescript namespace in keys of the namespace object.
If you look at the transpiled code above, you see that
goog.provide initializes the
my_project.my_ns object and the
y variables are nested into it.
Now, you probably wonder what’s the meaning of the
goog.require('cljs.core') piece of code; we will discuss
goog.require in another blog post.
You can learn more about google closure library here.