Summary
In this chapter, we learned about namespaces in Clojure. Namespaces are key Clojure concepts. We organize code into namespaces. We investigated various ways in which we can import namespaces in Clojure by using refer
, require
, and use
. With each option to import, we learned the syntax of importing functions and when to use each type of function. We went into depth and investigated the :only
, :exlude
, and :rename
keywords, which help us to fine-tune importing.
Then, we learned about Leiningen—a popular Clojure build tool. We created a Leiningen application and explored how Clojure projects are structured. We added dependencies on libraries. Finally, we saw how we can customize Leiningen projects using profiles. We created an application that accepted command-line arguments that were used by the application to customize the output.
In the next chapter, we will investigate host platform interop—accessing Java and JavaScript from Clojure.