This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-07
Channels
- # aws (2)
- # bangalore-clj (4)
- # beginners (62)
- # boot (74)
- # cider (408)
- # cljsrn (17)
- # clojure (117)
- # clojure-dusseldorf (1)
- # clojure-russia (21)
- # clojure-spec (17)
- # clojure-uk (15)
- # clojurescript (154)
- # cursive (3)
- # datomic (16)
- # emacs (33)
- # funcool (3)
- # hoplon (99)
- # off-topic (7)
- # om (10)
- # overtone (3)
- # portland-or (1)
- # protorepl (9)
- # re-frame (83)
- # reagent (11)
- # remote-jobs (1)
- # ring-swagger (24)
- # specter (10)
- # untangled (1)
- # yada (11)
@crimeminister: the intention is that s/form will return you something serializable
(As Clojure data)
There are some known bugs with that that are in process
Also there will be specs for spec forms
Which you can conform to retrieve data
Sounds great, thank you @alexmiller
Sounds like that will serve admirably for what I need
I guess my question above is still reasonable, but I solved my problem by reading the docs and realising that the retag
arg for a multi-spec can be a function
The only way to do it atm is to separate the spec into a var (or different registry spec) so you can refer to it
I’m trying to use :clojure.core.specs/arg-list
to parse an arg list, but the clojure.spec/every
of :clojure.core.specs/map-bindings
means that I can’t fully destructure the arg-list with conform
is there a way to force the every
to conform?
Not that I know of, @stathissideris. If you want that behavior you'll probably have to roll your own with clojure.spec/coll-of
.
@zane thanks! I was hoping to use the “official” clojure spec to parse the args, but it looks like I’ll have to copy and modify it
You could always just validate with clojure.spec/valid?
and :clojure.core.specs/arg-list
and then write your own transformation function.
my main use case is not validation, I’d like to extract the names of arguments (and be able to handle all cases of destructuring etc)