macro | since v0.0-2657 | Edit |
(require-macros & args)
Only usable from a REPL.
This is a way for ClojureScript to load macros from Clojure files.
The usage is similar to the require
form.
There is a nicer alternative if the Clojure macros file has the same name as a
ClojureScript file in the same directory, which is a common pattern. In this
case, you can just use the :include-macros
or :refer-macros
flag of the
require
form.
(require-macros '[cljs.core.async.macros :refer [go]])
Similar to require but only for macros.
(core/defmacro require-macros
[& args]
`(~'ns* ~(cons :require-macros args)))