jvm.namespace.eval
eval-ns
added in 3.0
(eval-ns ns forms)Evaluates a list of forms in an existing namespace (eval-ns ’std.lib ’(long? 1)) => true
eval-temp-ns
added in 3.0
(eval-temp-ns forms)Evaluates a list of forms in a temporary namespace (eval-temp-ns ’[(def inc1 inc) (defn inc2 x(+ 1 x)) (-> 1 inc1 inc2)]) => 3
“All created vars will be destroyed after evaluation.”
(resolve ’inc1) => nil
with-ns
macro
added in 3.0
(with-ns ns & forms)Evaluates body forms in an existing namespace given by ns.
(require ’std.lib) (with-ns ’std.lib (long? 1)) => true
with-temp-ns
macro
added in 3.0
(with-temp-ns & forms)Evaluates body forms in a temporary namespace.
(with-temp-ns (def inc1 inc) (defn inc2 x(+ 1 x)) (-> 1 inc1 inc2)) => 3
“All created vars will be destroyed after evaluation.”
(resolve ’inc1) => nil