Consider the following cloure.spec-alpha2 example:
  
(def v [0])
(s/def ::thevec vector?)
(s/def ::data (s/coll-of number? :kind ::thevec))

(s/valid? ::data v) ;;=> returns false, my expectation is that it should 
return true
(s/explain ::data v) ;;=> prints "Success!", which inconsistent to s/valid?

(s/def ::data2 (s/coll-of number? :kind vector?))
(s/valid? ::data2 v) ;;=> returns true, as expected

I expect (s/valid? ::data v) to return true, but it returns false. 
Moreover, s/explain prints "Success!" which is inconsistent to s/valid? for 
this example.
If I replace :kind ::thevec by :kind vector?, everything is fine. Why is 
that (the spec documentation says: ":kind - a predicate or spec").

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/70b194ee-703f-48fa-9b1a-915f5dbf90d6%40googlegroups.com.

Reply via email to