© 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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.