so as Rich mentions in hacker news, you can get declare to work in
other namespaces which does convert the circular dependencies issue
from a compile time problem to a potential run-time one.

The definition is pretty much what you would expect:

(defmacro remote-declare [name]
  "declares the supplied ns-qualified name with no bindings, useful
for creating circular dependencies"
  (let [[ns v] (.split (str name) "/")
        orig-ns (str *ns*)]
    `(do (in-ns '~(symbol ns))
         (clojure.core/declare ~(symbol v))
         (in-ns '~(symbol orig-ns)))))

i'm not really seeing any major downsides to using it.  maybe i'm
missing something.

https://gist.github.com/939421
https://gist.github.com/939419
https://gist.github.com/939420
https://gist.github.com/939426

-- 
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

Reply via email to