Using macroexpand inside a macro in Clojurescript doesn't work

Hi everybody!,Does anybody knows why this macro

(defmacro tester [form]
(println (macroexpand form))

When used from clojure :

(tester (let [a 5] a))
;; prints
(let* [a 5] a)

But when used from clojurescript :

(tester (let [a 5] a))
;; prints
(let [a 5] a)

So the same macro doesn’t do the same, macroexpand doesn’t work at macro level when the cljs compiler calls it

There is no macroexpand in ClojureScript. ClojureScript cannot expand macros, only Clojure can.

And in your case, I’m guessing maybe your macro isn’t defined properly for ClojureScript. I forgot the rules, but it is a bit tricky. The macro has to be in a .clj file, and in ClojureScript you need to call require-macro.

Sorry, maybe I didn’t specified all the details.

This is a normal Clojure macro defined in a macros.clj file.

So it goes something like this:

In macros.clj :

 (ns project.macros)

(defmacro m [form]
  (let [form2 (macroexpand form)]
        ;; do something with form2

In test.cljs :

(ns project.test
   (:require-macros [project.macros :refer [m]])

(println (and 1 2))

So if I use that same macro from a clojure project, form2 gets bind to

(let* ... (if* ...))

While when using it from clojurescript form2 gets bind to

(and 1 2)

Shouldn’t the macro be expanding the same, since it is compile time and clojure world?