ClojureScript master now has cljs.core/eval
. This delegates to cljs.core/*eval*
which, by default throws, but you can bind it to any implementation that can compile and evaluate ClojureScript forms.
If you require the cljs.js
namespace (which is the main support namespace for self-hosted ClojureScript), then cljs.core/*eval*
is set to an implementation that uses self-hosted ClojureScript for this capability. This means that all self-hosted ClojureScript environments will now have a first-class eval
implementation that just works. For example, Planck master:
$ planck -q
cljs.user=> (eval '(+ 2 3))
5