January 2018
Intermediate to advanced
336 pages
7h 56m
English
If the :main directive is defined in the project.clj file of the project, then the project can be run by directly calling the lein run command. lein run expects the namespace specified under :main directive to contain the Clojure main function. For example, the playground.core namespace must have a main function defined for lein run to work, as shown in the following implementation. Since the :source-paths parameter in the updated configuration of project.clj points to src/clj instead of the default src/, the core.clj source file, as shown in the following code, must reside within the src/clj/playground/ directory as per the namespace and configured source paths:
(ns playground.core (:gen-class))(defn foo "I don't do a whole ...
Read now
Unlock full access