Emit warning when compiling macro to function in non-self host environment

Description

I have defined a macro in a .cljc file:

Sometimes (but not always) I would see an error in the browser logs:

Why is a compile time macro ending up as a run time function in the target JS? Quite a surprise. After a discussion on Slack this turned out to be related to self-hosted ClojureScript. The conversation in Slack is recorded in the attachment slack.txt.

The library https://github.com/cgrand/macrovich turned out to have the solution for me.

It would be helpful if the compiler did not generate a run-time function from a macro in non-self hosted mode, or at least emit a warning.

Environment

JVM Clojure

Attachments

1

Activity

Details

Assignee

Reporter

Priority

Created March 8, 2018 at 4:26 PM
Updated March 8, 2018 at 6:28 PM