With Clojure 1.9.0-alpha10:







*user=> (s/def ::interval-with-cloj-and #(and   (> % 0.0) (< % 1.0)))user=> 
(s/def ::interval-with-spec-and #(s/and (> % 0.0) (< % 1.0)))user=> 
(s/valid? ::interval-with-cloj-and 1.0)false*That's what I expected.


*user=> (s/valid? ::interval-with-spec-and 1.0)true*

That's not what I expected.

In fact, as far as I can tell, (valid? ::interval-with-spec-and x) will 
return true for any number x.  What does spec/and mean, then?  I thought 
that in this context it would mean the same as Clojure's normal 'and'.  
That's what the first example of its use in the Clojure.spec Guide seems to 
show.  I must be misunderstanding something basic and perhaps obvious.

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to