io.jesi.backpack.env
cljs?
(cljs? env)
Take the &env from a macro, and tell whether we are expanding into CLJS.
converter
multimethod
Platform specific converters. Takes the env
(from &env
or platform keyword) and returns a converter function. The converter function takes a symbol and returns the platform specific version of that symbol.
platforms
An atom containing the platform specific predicates. Is an map of predicates, and their platform keyword value. The predicate should take a macro &env
and return a boolean. See https://clojure.org/guides/reader_conditionals for platform keywords.
symbol
(symbol env sym)
Takes the target env
(from &env
or platform keyword), and a quoted symbol. Transforms the symbol to platform specific symbol.
(symbol :cljs 'clojure.core.async)
=> cljs.core.async
transform
macro
(transform quoted-form)
Transforms the symbols in a quoted form to platform specific symbols. Takes a quoted-form
to be transformed. Use this in macros. e.g. (defmacro go [& body]
(env/transform (async/go ~@body)))`
WARNING: Will throw StackOverflowError for deeply nested forms. Use io.jesi.backpack.env/symbol
to transform individual symbols
transform*
(transform* env quoted-form)
Transforms the symbols in a quoted form to platform specific symbols. Takes an env
(from &env
or platform keyword), and a quoted-form
to be transformed.
WARNING: Will throw StackOverflowError for deeply nested forms Use io.jesi.backpack.env/symbol
to transform individual symbols