Thanks for this. Gives me a much better idea of where to start. This is the
second time that I've run across a need to switch libraries on the fly, so I
figure it's time to work out a better approach.
--
You received this message because you are subscribed to the Google
Groups "Clojure"
The backtick namespace-qualifies symbols automatically:
(macroexpand-1 '(switch-foo-library! x))
;=>
(clojure.core/defn
user/foo
[y__3652__auto__]
((clojure.core/resolve (clojure.core/symbol (clojure.core/str x "/foo")))
y__3652__auto__))
The error is about the "user/foo" name of the defn.
I'm working on some code where I want to evaluate different implementations
of the same functionality. Each implementation of a function lives in its
own namespace. For example, suppose that I have the following simplified
code.
(ns tst1)
(defn foo [x] (+ x 1))
(ns tst2)
(defn foo [x] (+ x