This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-04-22
Channels
- # announcements (1)
- # beginners (27)
- # calva (11)
- # cider (37)
- # clj-kondo (44)
- # clojure-europe (14)
- # clojure-nl (1)
- # clojure-norway (6)
- # clojure-uk (4)
- # clojurescript (6)
- # cursive (17)
- # data-science (1)
- # datomic (27)
- # duct (4)
- # events (1)
- # fulcro (3)
- # graphql (14)
- # lingy (3)
- # lsp (1)
- # malli (16)
- # off-topic (23)
- # portal (19)
- # reitit (10)
- # releases (2)
- # ring (4)
- # ring-swagger (2)
- # scittle (22)
- # shadow-cljs (33)
- # sql (19)
- # testify (1)
Suppose I am writing a library that supports Clojure and ClojureScript. The library exports a macro. Most ClojureScript users are not using self-hosted ClojureScript, so it makes sense to define macros in a cljc
file by keeping defmacro
forms in Clojure. However, in the case of self-hosted ClojureScript, we want these macros, too. So rather than
#?(:clj (defmacro ...))
we would want
(defmacro ...)
directly in a CLJC file. Is there harm in doing this when consuming the library from non-self-hosted CLJS? I’ve always had the habit of avoiding defmacro
forms in CLJS code entirely, so I am not sure what the behavior is.You'll probably want to use https://github.com/cgrand/macrovich
Or maybe this https://github.com/mfikes/chivorcam