yazz.com
yazz.com

Reputation: 58786

In clojurescript how can I change the namespace?

I am trying to change the namespace when I evaluate code with cljs.js but fully qualifying something or using (ns seems to do nothing). Anyone knows how to do this?

Upvotes: 2

Views: 204

Answers (1)

yazz.com
yazz.com

Reputation: 58786

I managed to do this in the end by doing this:

(cljs/eval-str (cljs/empty-state) string-to-evaulate 'foo.bar
                    {
                      :eval cljs/js-eval
                      :load load-fn
                      :source-map true}
                    (fn [result]
                      (do
                        (js/eval (:value result))
                        result))))

Upvotes: 2

Related Questions