Skip to content

Instantly share code, notes, and snippets.

@runejuhl
Created September 11, 2018 15:58
Show Gist options
  • Save runejuhl/378066a83f39677ef87cfee10e47a441 to your computer and use it in GitHub Desktop.
Save runejuhl/378066a83f39677ef87cfee10e47a441 to your computer and use it in GitHub Desktop.
Compile CLJS to JS from Clojure
(with-out-str
(let [ env (merge (cljs.analyzer/empty-env) '{:ns {:name some.ns}})]
(cljs.compiler/emit (cljs.analyzer/analyze env '(+ 1 2)))))
;; "((1) + (2));\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment