Hi Michele,
Pass a sequence of maps, not just a map:
(every? #(:x %) [{:x "s"}])
-> true
Cheers,
Stu
> In the book "Programming Clojure" (p2_0, pdf, page 185) "Adding
> Validation to Refs" there is this code:
>
> (def validate-message-list (partial every? #(and (:sender %) (:text
> %))))
>
> This works fine as a validator, but when I try the code directly - not
> as a validator - it returns false. I also tested with a simple "if" to
> see the difference.
>
> (every? #(:x %) {:x "s"})
> -> false
>
> (if (#(:x %) {:x "s"}) "TRUE" "FALSE")
> -> "TRUE"
>
>
> What do I not understand?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to [email protected]
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> [email protected]
> 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 post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en