How do I get &env data in CLJS-macros?

Your macro expands to code that will be evaluated. So you see the b symbol getting replaced my the value you passed as b, so 5.

(defmacro get-env2 []
  `(quote ~(:locals &env)))

This should work if you just want the pure data.

5 Likes