This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-11
Channels
- # announcements (1)
- # aws (5)
- # beginners (8)
- # biff (7)
- # calva (32)
- # cider (26)
- # clj-kondo (6)
- # clojure (100)
- # clojure-europe (6)
- # clojure-greece (1)
- # clojurescript (15)
- # core-logic (3)
- # fulcro (2)
- # honeysql (4)
- # hoplon (39)
- # hyperfiddle (11)
- # lsp (12)
- # other-languages (2)
- # podcasts-discuss (1)
- # squint (30)
If I define a map spec like (s/keys :req [:x/y])
, is there a way to get an equivalent spec from it, where the keys are not namespaced (`:req-un`)?
I'm not aware of a direct spec transformation of this nature, but I think describe
could be used to get a data description of the spec back, and then a related spec could be constructed using that description
Probably simpler to just define the key vector in its own def and re-use that with :req
and :req-un
.
you can't actually do that as s/keys is a macro and expects a literal vector there
but you can macro around s/def