May 2018
Beginner to intermediate
290 pages
6h 43m
English
Now that you’ve seen how to create new namespaces in the REPL and how to get namespaces loaded with require, we’re ready to take the final step: defining a namespace of our own in a real .clj file in a directory project.
Let’s start by creating a new Clojure application. Recall from Chapter 1, Hello, Clojure that we can use Leiningen to create a new Clojure project like this:
| | $ lein new app blottsbooks |
Run those commands, and you will end up with a fully functional, if skeletal, Clojure project. For our purposes, the key bit of the project is a single source file that you’ll find at src/blottsbooks/core.clj.
Inside of that file you’ll find the following:
| | (ns blottsbooks.core ... |
Read now
Unlock full access