|
The code (prn #js [1 2])correctly compiles to cherry_core.prn.call(null, [1, 2]);But now let's say that I want to refactor said code with a macro, by doing ;; file macros.cljs
(ns macros)
(defmacro append-two-then-as-js [x]
(quote #js [~x 2])
;; file main.js
(ns main
(:require-macros
[macros :refer [append-two-then-as-js]]))
(prn (append-two-then-as-js 1))The resulting code is cherry_core.prn.call(null, [object Object]);Problem: Question: |
Replies: 3 comments 7 replies
|
You can't do that. Just don't use |
|
|
|
@ranfdev In the latest cherry version the key changed to |
Actually after digging in some more, if you would return from the macro:
on the returned map, I think cherry might already translate it to a JS object at compile time.