Fork me on GitHub
#clojure-spec
<
2017-12-22
>
bfabry00:12:11

seems to be exactly what clojure.java.jdbc does

cfleming00:12:26

Thanks, I’ll check it out.

cfleming00:12:52

in fact, the specs could even be in their own library I imagine.

bfabry00:12:11

well if it works for core 🙂

cfleming00:12:29

Yeah, but core is special 🙂

cfleming00:12:58

Ok, great - looks like that will work fine - thanks!

bbloom00:12:47

what’s the idiom for negating a spec? ie if i want to greedly parse excluding something

bbloom00:12:48

just use #(not …) ?

bbloom00:12:46

yeah or that

bbloom00:12:02

just wondering if there was any negative match regexes or anything like that

bbloom01:12:33

i guess i’m struggling with a non-greedy (reluctant?) s/* pattern

andy.fingerhut01:12:44

Has anyone attempted to write code that determines the 'difference' between two specs yet? That this is possible to do for "vanilla" regular expressions was, I recall, mentioned as a motivating factor for spec to be include regex matching. (I realize, of course, that spec generalizes vanilla regex's in a way, with extra side conditions via and/or, such that it might not always be possible to apply those regex diff algorithms in those cases).

andy.fingerhut01:12:59

s/be include/be based on/

Alex Miller (Clojure team)01:12:29

I don’t think it’s going to be efficient to do so without leveraging the guts of the regex spec impl

cfleming02:12:35

Is it considered idiomatic to name things that I don’t care about capturing :_?

misha09:12:06

@cfleming I've seen it used. I prefer :_actual-name-of-thing-you-ignore both for keywords and symbols (documentations is hard to come by these days)

cfleming09:12:06

@misha Thanks. This is for constant symbols and keywords in macro grammars, I had things like (s/cat <whatever> :from #{:from} <whatever>) which seems a bit redundant.

cfleming09:12:21

(i.e. when capturing a constant :from)

misha10:12:54

of course there are things which are impractical to document (in any way)

triss16:12:52

is it possible to look up the spec for a function?

arohner16:12:23

(s/form (s/spec 'foo/bar))

athos16:12:46

You probably mean s/get-spec rather than s/spec ?

curlyfry21:12:37

@triss clojure.repl/doc will show you any specs for a function

pablore22:12:39

hello, is there any way to define a spec for a sorted collection?