I think Timothy Baldridge had a great answer. For example, I often have 
records which use each other's constructors. But you can put your factoy 
methods in a map of dependencies.

I generally have a build function which takes a hash map as an argument, 
associates the various data and functions that other modules depend on, and 
returns the updated hashmap. Each module has such a function and at the top 
level I build the composite map with the modules I'll be using.

Not only does this eliminate those nasty cyclic dependencies, it allows me 
to easily swap different implementations by just changing the choice of 
build functions to call at the top level.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to