which invokes "(compile 'foo.main)". I then get "java.lang.Exception: Unable to resolve symbol: a in this context".
foo.main uses foo.util. foo.util uses foo.main. That's a circular reference. There are ways around this (e.g., create foo.main in foo.util, then use declare to ensure that `a` exists), but I suggest you rearrange your namespaces to avoid the circularity.
Another thing I've noticed is that even during compilation, the order that functions are definied in a source file matter. That makes sense to me when a clj file is run as a script, but when clojure code is getting compiled, why should it matter which order things are defined in? Is this behavior related somehow to my compilation error?
Because you can redefine things. Order does matter. If you want a forward declaration, use declare.
http://richhickey.github.com/clojure/clojure.core- api.html#clojure.core/declare
-- 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