This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-25
Channels
- # aleph (9)
- # announcements (2)
- # babashka (32)
- # babashka-sci-dev (72)
- # beginners (77)
- # calva (1)
- # cider (3)
- # clj-kondo (19)
- # clojure (61)
- # clojure-brasil (13)
- # clojure-europe (25)
- # clojure-italy (1)
- # clojure-nl (2)
- # clojure-norway (27)
- # clojure-uk (23)
- # clojuredesign-podcast (6)
- # clojurescript (12)
- # conjure (2)
- # core-typed (3)
- # cursive (6)
- # datalevin (2)
- # datomic (13)
- # emacs (9)
- # events (19)
- # fulcro (6)
- # graphql (11)
- # gratitude (2)
- # helix (3)
- # honeysql (16)
- # jobs (1)
- # lsp (89)
- # malli (33)
- # meander (14)
- # off-topic (87)
- # pathom (4)
- # polylith (7)
- # portal (4)
- # practicalli (1)
- # rdf (6)
- # reagent (2)
- # releases (8)
- # remote-jobs (1)
- # shadow-cljs (59)
- # sql (8)
- # tools-deps (14)
- # xtdb (18)
https://twitter.com/MitjaBezensek/status/1507428796223401985?s=20&t=PcAofLxjgU3aQslNzbJnsw We have a lot of code at Pitch, but itβs still pretty easy to get around and fun to work with. Anyone else have large CLJS projects that they still like working with?

In Clojure, if I want to check if a function supports metadata, I can check (instance? clojure.lang.IObj value)
. What is the corresponding test in Clojurescript?
(defprotocol IMeta
"Protocol for accessing the metadata of an object."
(^clj-or-nil -meta [o]
"Returns the metadata of object o."))
(defprotocol IWithMeta
"Protocol for adding metadata to an object."
(^clj -with-meta [o meta]
"Returns a new object with value of o and metadata meta added to it."))
Thank you @U2FRKM4TW! How did you find the relative code? Grepping the cljs source?
So my check would be (instance? #?(:clj clojure.lang.IObj :cljs IWithMeta) value)
, right?
Just opened core.cljs
in my IDE and looked through all the symbols containing the word meta
.
The check seems reasonable to me, although not sure why you have an FQN there for IObj
but not for IWithMeta
.
I didn't test the cljs part yet (it's my first cljc experiment, and I'm not used to open it in both repls), so the cljs side could very well be wrong!