I think Clojure should provide more information when certain error
conditions occur. Example:

(when-not (= (Integer. (:userid json)) (Integer. (:userid a-user)))

NOTE: (:userid a-user) is always some sort of number.
(:userid json) is always a String.

After testing (Integer. (:userid a-user)) _sometimes_ fails with:
java.lang.IllegalArgumentException: No matching ctor found for class
java.lang.Integer

In this specific case you might argue that I don't know how to compare
two numbers in clojure. And that might be true:-)

In any case, I would find it _really_ helpful to have the (class) of
the arg that failed. I think that this is something that generally all
people using Clojure would be thankful for at one time or another.

In this case, having the (class) would tell me that the failed arg was
java.lang.Long. I'd then know immediately the reason for the problem
and the solution.

Any reason why this does _not_ make sense?


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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to