This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-01-01
Channels
- # beginners (2)
- # cider (20)
- # cljsjs (3)
- # clojure (86)
- # clojure-italy (2)
- # clojure-spec (7)
- # clojure-uk (3)
- # clojurescript (8)
- # defnpodcast (3)
- # emacs (10)
- # figwheel (1)
- # hoplon (9)
- # immutant (4)
- # keechma (2)
- # luminus (11)
- # off-topic (13)
- # re-frame (6)
- # reagent (3)
- # ring (1)
- # specter (5)
- # sql (2)
- # unrepl (127)
Thanks @dominicm for the pointer. Looks great, seems to lean on custom strict-keys
Spec to catch the typos. Coudn’t get it working as it uses really old version of spec, but will poke around to see if I could get it working. Different artifact name btw in Clojars and in Github.
Hi everyone- I have a clojure DSL that comes in two variants that are about 95% the same and I want to write a single spec that validates both variants- What is the best way of doing this? Basically what I want to do is write about a hundred clojure.spec/def
declarations that are the same for both variants, but a few deeply nested items will need idiosyncratic logic, looking something like:
(s/def :deeply/nested-item
(if variant1?
variant-1-specification
variant-2-specification))
I know I can solve this through some nasty macrology (that maintains two separate namespaces of specs for the two variants, so that the idiosyncratic differences can be "spliced in") but usually it is a bad idea to lean heavily on complex macros... Thanks for any tips!aaron brooks was just talking to me on twitter about this sort of thing
paging @abrooks
@gfredericks yep, that's my situation...