Dynamically generate global vars in a namespace from a list

195 Views Asked by At

I'm working on a thin wrapper around a js library and I want to dynamically generate variables from a list for use in other namespaces.

e.g. Given a list of (:foo :bar :baz), I want to dynamically generate:

(def foo (some-fn foo))
(def bar (some-fn bar))
(def baz (some-fn baz))

I found some solutions for Clojure using interns, but that differs in implementation in CLJS. Alternatively, I can generate and print the necessary expressions and evaluate it each time but I'm hoping for a more programmatic solution.

0

There are 0 best solutions below