I don't understand, the error message you get is the error that occurred. the docstring from even? says it throws an exception if the argument is not and integer.
I would hope that anyone that has read the docstring for contains? would not use (contains? 'foo 'bar), because, uh, that just makes no sense. I mean that usage does not match what is indicated in the docstring 2009/11/9 Tiago Antão <tiagoan...@gmail.com>: > > Hi all, > > Just a question about the consistency of the API: > When one passes a "strange" (ie, wrong type) object to contains?, say > (contains? 'blab 'a) > the result is a false. > But if one passes the wrong type to, e.g., even?, like > (even? 'a) > The result is: > java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to > java.lang.Number (NO_SOURCE_FILE:0) > > This seems a bit inconsistent, in the sense that one would expect the > same behavior for the same kind of error. > > So the question is: is there any thing less obvious here (at least for > me), or is this a real issue with the API? > > Thanks, > Tiago > > -- > "The hottest places in hell are reserved for those who, in times of > moral crisis, maintain a neutrality." - Dante > > > > -- And what is good, Phaedrus, And what is not good— Need we ask anyone to tell us these things? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---