This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-04-09
Channels
- # announcements (4)
- # babashka (16)
- # beginners (4)
- # calva (19)
- # cider (61)
- # clj-commons (3)
- # clj-kondo (8)
- # clojure (68)
- # clojure-boston (1)
- # clojure-brasil (1)
- # clojure-europe (16)
- # clojure-hungary (2)
- # clojure-nl (1)
- # clojure-norway (39)
- # clojure-spec (2)
- # clojure-uk (4)
- # clojuredesign-podcast (16)
- # clojurescript (17)
- # core-typed (7)
- # cursive (17)
- # data-science (7)
- # datalevin (19)
- # datomic (1)
- # events (6)
- # hyperfiddle (6)
- # kaocha (9)
- # london-clojurians (2)
- # malli (10)
- # off-topic (1)
- # other-languages (24)
- # portal (2)
- # practicalli (19)
- # rdf (1)
- # reitit (2)
- # releases (2)
- # shadow-cljs (18)
- # testing (1)
- # xtdb (20)
- # yamlscript (4)
I have this list list of fields related with a customer:
(s/keys :req-un [:customer/gender
:customer/birthdate
:customer/height
:customer/weight]
:opt-un [:customer/middle_name
:customer/address]))
I want to re-use the req-un / opt-un keys list for more scenarios.
extracting them outside and saving those under def or s/def, and doing:
(s/def ::basic-customer
(s/keys :req-un ::basic-customer-keys
:opt-un ::extra-customer-keys))
returns an error: Don't know how to create ISeq from: clojure.lang.Keyword
Anyone knows another way perhaps to re-use?Because this is a macro that expects a literal vector, it is not easy to pass those as data, unless you wrap in another macro to do that replacement