It seems like the :req impls should go further to disallow trash input,
it's not immediately clear that they only allow namespaced keywords.

For example:
> (s/valid? (s/keys :req ["a"]) {:a 5})
true
> (s/valid? (s/keys :req [5]) {:a 5})
true

What ends up happening in practice, is (filter keyword? (flatten req)),
which is suspect.

Could/should spec be used to check itself? That's the lisp way, after all.
To do so here, we might need more map-checking builtins than s/keys.

On Wed, May 25, 2016 at 1:48 PM Brent Millare <brent.mill...@gmail.com>
wrote:

> What's the difference between clojure.spec/or and clojure.spec/alt? They
> seem to accept the same inputs, multiple keyword-predicate pairs, and
> output tagged values when used with clojure.spec/conform. Is
> clojure.spec/or usable within a regular expression?
>
> --
> 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.
>

-- 
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