Thursday, February 18, 2010

Thoughts on namespace management

Konrad Hinsen recently posted some ideas for handling namespaces

http://onclojure.com/2010/02/17/managing-namespaces

There are a lot of good ideas in there, and right now I'd like to talk specifically about the proposed :like & :clone clauses.  I have a bit of a different approach.

Supposed we add a new project file, namespace_config.clj.  It would be a basic rules engine for configuring namespaces.  I'm thinking there would be a macro, extend-ns, that is roughly defined as follows. The exact implementation needs work.



This lets us set up a series of predicates & resulting actions that would be applied to each ns in the project. Everything would be done in one central location, so (hopefully) that would cut down on maintenance.