Are nil specs valid?

93 views
Skip to first unread message

Chas Emerick

unread,
Jun 20, 2016, 2:21:50 PM6/20/16
to cloju...@googlegroups.com
I see that :clojure.spec/any is defined, so I was surprised that this
doesn't fail loudly:

(s/conform nil "foo")

I had some data conforming when I was expecting problems, and the
proximate cause was a typo in destructuring.

Are nil specs considered valid?

My experience with clojure.spec has been quite positive so far.

Thanks,

- Chas

Alex Miller

unread,
Jun 20, 2016, 2:27:54 PM6/20/16
to cloju...@googlegroups.com
I'd say no, "nil" is not a valid spec and should fail.



--
You received this message because you are subscribed to the Google Groups "Clojure Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure-dev...@googlegroups.com.
To post to this group, send email to cloju...@googlegroups.com.
Visit this group at https://groups.google.com/group/clojure-dev.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages