>> (defn refer-private [ns] >> (doseq [[symbol var] (ns-interns ns)] >> (when (:private (meta var)) >> (intern *ns* symbol var)))) >> >> As he says, "this is slightly evil, and I would never recommend it for >> any purpose except unit testing, but there it is." This works, and the >> macro approach also makes sense to me. > > I use it, too. > >> But these threads are respectively three and two years old. Have there >> been any changes in Clojure since then which solve this problem or >> provide a recommended workaround? > > Not that I know of.
To access a private var, simply deref through the var: @#'some-ns/some-private-var This is in the coding standards doc (http://dev.clojure.org/display/design/Library+Coding+Standards). The doc is pretty short and worth reading if you haven't. Stu Stuart Halloway Clojure/core http://clojure.com -- 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