Fork me on GitHub
#cljs-dev
<
2015-12-29
>
mfikes01:12:19

@vibl FWIW your example evaluates to (inc 1) in bootstrapped ClojureScript

vibl15:12:27

Can anyone confirm they can use macroexpand within a macro in non-bootstrapped cljs?

(defmacro test-macroexpand [] `(quote ~(macroexpand-1 '(-> 1 inc))))
should return (inc 1), as it does in clj. But it returns (-> 1 inc) instead when the macro is called from cljs.

dnolen15:12:21

@vibl as I said before there is no support for macroexpand and macroexpand-1 in ClojureScript

dnolen15:12:38

if you want to understand how to make it work you will need to look at the source of the cljs.analyzer namespace

dnolen15:12:49

and be OK with coding against something that may or may not work in the future

dnolen15:12:26

@vibl if you want official support for this functionality submit a patch for cljs.analyzer.api

vibl17:12:27

@dnolen I get that there is not support for macroexpand in ClojureScript, but because macros are in Clojure, I thought that using macroexpand within a macro would work.

dnolen17:12:07

@vibl does not officially work and has never officially worked

vibl17:12:56

@dnolen Ok. Thanks for your time simple_smile