1

I would like to give a name to a macro and I can do it in Clojure with this method clojure.tools.macro/name-with-attributes.

What is the equivalent method in ClojureScript ?

1 Answer 1

3

Unfortunately you can only define macros in Clojure, not in ClojureScript. But once defined, you can use them in both.

As explained in this answer, macros are applied at compilation. And because the compiler is written in Clojure, macros must be implemented in Clojure as well.

Hope this helps.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.