Why do Many Clojure Projects Have a "core" Namespace?
Project Names and "core" Namespaces in Clojure
Almost every Clojure project seems to have a core namespace. This is something that lein new project-name creates, and people just go with the flow.
I don't like this, and it turns out I'm not the only one. See Where does the "core" namespace nomenclature derive from? for some discussion.
Leiningen does different things depending on the type of name you give it. I can't make a lot of sense of this, but here's what my playing has revealed (with Leiningen 2.7.1).
A Simple Name
(This is what most people seem to do.)
lein new simple-name
Creates a directory named
simple-namewith a project namedsimple-name.Creates namespaces named
simple-name.coreandsimple-name.core-test.
If you do this, please immediately delete the namespaces and then create other ones with better names.
A reverse-domain-name/name -Style Name
(I think I plan to mostly do this in future.)
lein new com.backwards.domain/my-name
Creates a directory named
my-namewith a project namedcom.backwards.domain/my-name.Creates namespaces named
com.backwards.domain.my-nameandcom.backwards.domain.my-name-test.
An x.y Name
lein new foo.bar
Creates a directory named
foo.barwith a project namedfoo.bar.Creates namespaces named
foo.barandfoo.bar-test.