On Jul 21, 2016, at 1:23 PM, Mars0i <mars...@logical.net> wrote: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.
And deleting a post from the Google Groups interface still leaves everyone else’s replies – and in this case Steve’s first reply to your included your original post anyway…
https://groups.google.com/forum/?hl=en#!topic/clojure/MxJOgQJPGN8
Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
Just for future reference this is a mailing list and not a traditional forum, so after you post something here it will email everyone subscribed.