Hi folks,
New lib in contrib: "with-ns" -- a library to temporarily switch
namespaces at run-time.   People request this occasionally, and I
finally came up with a way to do it.  The code is sneaky, and it
relies on "eval", but it works.  Here's the doc:

clojure.contrib.with-ns/with-ns
([ns & body])
Macro
  Evaluates body in another namespace.  ns is either a namespace
  object or a symbol.  This makes it possible to define functions in
  namespaces other than the current one.
-------------------------
clojure.contrib.with-ns/with-temp-ns
([& body])
Macro
  Evaluates body in an anonymous namespace, which is then immediately
  removed.  The temporary namespace will 'refer' clojure.core.

-Stuart Sierra
--~--~---------~--~----~------------~-------~--~----~
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
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