I'm trying to use defmacro
in ClojureScript, but I'm getting a console error:
TypeError: 'undefined' is not an object (evaluating 'crd.core.defmacro.call')
Here's the test code that's 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 on what I'm doing wrong?
My failure: I didn't read Differences from Clojure. ClojureScript does support macros, but only in .clj files that are imported with require-macros
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With