This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-17
Channels
- # announcements (7)
- # beginners (9)
- # calva (17)
- # clj-kondo (11)
- # clojure (68)
- # clojure-austin (2)
- # clojure-bay-area (3)
- # clojure-europe (19)
- # clojure-gamedev (10)
- # clojure-nl (1)
- # clojure-norway (73)
- # clojure-spec (5)
- # clojure-uk (5)
- # clojuredesign-podcast (6)
- # clojurescript (65)
- # community-development (28)
- # conjure (1)
- # datahike (34)
- # datomic (36)
- # emacs (11)
- # funcool (1)
- # helix (13)
- # honeysql (36)
- # hyperfiddle (15)
- # jobs (1)
- # jobs-discuss (4)
- # malli (13)
- # nbb (21)
- # off-topic (51)
- # practicalli (20)
- # reitit (1)
- # releases (1)
- # ring (4)
- # squint (1)
- # tools-deps (14)
- # transit (8)
Hi everyone, I wanna spec sth like this :
[[:__ :TXC :BTC :ALT :PAXG ]
[:TT1 0M 0M 0M 0M ]
[:TT2 0M 0M 0M 0M ]
[:TT3 0M 0M 0M 0M ]
[:TT4 0M 0M 0M 0M ]
[:Others 0M 0M 0M 0M ]
]
but the following spec won't work :
(spec/def ::X-Header-Row (spec/cat :dont-care #{:__} :exposure-id-s (spec/+ ::Exposure-ID)))
(spec/def ::X-Row (spec/cat :g-id ::Group-ID :weights (spec/+ decimal?)))
(spec/def ::X (spec/cat :header ::X-Header-Row :rows (spec/+ ::X-Row)))
What is it that I'm not getting about how spec/cat
works and how can I spec that table ?
Thanks a lot in advancewon't work .... because?
regex ops combine to spec one collection, so you need to do something to separate the outer collection and the inner collection "levels"
probably the shortest path to that is to wrap s/spec around the ::X-Row cat