Defmacro not defined in ClojureScript?

I try to use defmacro in ClojureScript, but I get a console error:

 TypeError: 'undefined' is not an object (evaluating 'crd.core.defmacro.call') 

Here is the test code generating the error:

 (ns crd.core) (defmacro t [] `()) 

And the generated JavaScript code:

 goog.provide('crd.core'); goog.require('cljs.core'); crd.core.defmacro.call(null,crd.core.t,cljs.core.Vector.fromArray([]),null); 

Any pointers to what I'm doing wrong?

+4
source share
1 answer

My mistake: I have not read Differences from Clojure . ClojureScript supports macros, but only in .clj files that are imported using require-macros .

+9
source

Source: https://habr.com/ru/post/1403637/


All Articles