How are big clojure projects organized?
class, clojure, file, methods, namespaces
Solution
It is roughly:
namespace > files > vars
Note that:
- Namespaces are frequently defined in a single file, but don't have to be (you can use multiple files to define a namespace)
- vars can contain anything: functions, Java objects, data, macros etc. Most of the time, they will be either functions or top-level data literals
- Namespaces are dynamic: they can be modified at runtime. This gives you quite a lot of flexibility to organise your code in different ways if you want to (you can generate and populate your namespaces programatically for example)
See also:
- http://clojure.org/namespaces
Problem
In most programming languages you often have a "namespace > files > classes > methods" or similar organization. How is this done in clojure?