Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How are big clojure projects organized?

In most programming languages you often have a "namespace > files > classes > methods" or similar organization. How is this done in clojure?

like image 637
MaiaVictor Avatar asked Jun 24 '12 19:06

MaiaVictor


1 Answers

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
like image 51
mikera Avatar answered Nov 17 '22 13:11

mikera