Macros are executed at compile time, while import / require execute at runtime, there for macro definitions in the imported module has does not affect requirer.
There are few possible ways to go about this:
- Change import semantics, and read imported modules at compile time so that macros could be registered prior execution. Problem with this approach is tight coupling with node-js require semantics that may not be possible in browsers or be just overkill.
- Implement subset of clojure ns that would
understand clojurescript's :require-macros keyword. Problem with this is that it will look like clojure
but will behave differently not to say that ns is overkill and it's own dsl.
Macros are executed at compile time, while
import/requireexecute at runtime, there for macro definitions in the imported module has does not affect requirer.There are few possible ways to go about this:
understand clojurescript's :require-macros keyword. Problem with this is that it will look like clojure
but will behave differently not to say that
nsis overkill and it's own dsl.