© Mark McDonnell 2017

Mark McDonnell, Quick Clojure, https://doi.org/10.1007/978-1-4842-2952-1_9

9. Namespaces

Mark McDonnell

(1)southend-on-Sea, UK

Namespaces are a feature that allows the categorization of functions, symbols, and variables into well-defined groups. Later on in this chapter we’ll see that namespaces can also be translated and mapped to an actual file system directory structure.

Let’s start by using the REPL to demonstrate a simple example of how namespaces work. When we run lein repl we’re automatically dropped into a new user namespace, and that namespace is pre-loaded with the Clojure core library. You can tell what namespace you’re in by looking at the REPL console, which displays the current namespace just before your cursor ...

Get Quick Clojure: Effective Functional Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.