Fork me on GitHub
#clojure-spec
<
2017-01-07
>
alexmiller00:01:48

@crimeminister: the intention is that s/form will return you something serializable

alexmiller00:01:02

(As Clojure data)

alexmiller00:01:24

There are some known bugs with that that are in process

alexmiller00:01:02

Also there will be specs for spec forms

alexmiller00:01:20

Which you can conform to retrieve data

crimeminister01:01:41

Sounds great, thank you @alexmiller

crimeminister01:01:45

Sounds like that will serve admirably for what I need

schmee10:01:47

is there a way to access the default gen when overriding a gen in s/spec?

schmee10:01:07

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

alexmiller14:01:34

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

stathissideris15:01:00

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

stathissideris15:01:12

is there a way to force the every to conform?

zane16:01:41

Not that I know of, @stathissideris. If you want that behavior you'll probably have to roll your own with clojure.spec/coll-of.

stathissideris16:01:39

@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

zane16:01:09

That's what it looks like to me.

zane16:01:31

You could always just validate with clojure.spec/valid? and :clojure.core.specs/arg-list and then write your own transformation function.

stathissideris16:01:11

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)