May 2018
Beginner to intermediate
290 pages
6h 43m
English
When it comes to Clojure namespaces, there is one giant walking the land: clojure.core. The clojure.core namespace is where all of those fundamental, predefined functions—things like println and str and count—live. So why is it that we can just write println and count and not clojure.core/println and clojure.core/count? We rarely need the clojure.core/ because just after it creates a new namespace, ns does the equivalent of this:
| | (require '[clojure.core :refer :all]) |
The :all option is an even more dramatic version of the :refer that we saw earlier. It pulls in all the bindings from the other namespace. That’s great for booting up a language environment, but perhaps not something you should use in everyday code.
If you are curious ...
Read now
Unlock full access