Fork me on GitHub
#clojure-spec
<
2019-01-06
>
mathpunk04:01:07

This doesn't look right at all. Am I using instrument incorrectly?

lilactown04:01:29

@mathpunk :args needs to be, at the very least, a collection

lilactown04:01:51

you can think of it as, you’re verifying the [s] collection

lilactown04:01:05

usually I use s/cat. e.g.:

(s/fdef friendlier
  :args (s/cat :s string?))

mathpunk04:01:45

ok i think I see this

lilactown04:01:18

(s/cat :s string?) checks if the first element in the sequence is a string

mathpunk04:01:53

and we're verifying an args /vector/, which happens to have one element

lilactown04:01:31

it’s actually a sequence, I think. you can see it’s printed as ("World")

mathpunk04:01:44

ok this makes sense, thank you

mathpunk04:01:00

and yeah it's right there but i guess i thought those were decorative parens :face_with_rolling_eyes:

lilactown04:01:35

yeah 😅 trust me I went through the same confusion the first time I tried to use fdef