+1. I find Clojure error messages a little bit cryptic, and this is a nice
effort to change this.

2009/10/25 MarkSwanson <mark.swanson...@gmail.com>

>
> Hello,
>
> Someone recently posed the question: (why doesn't this work)
> (into {} (map #([% (* % %)]) [1 2 3 4]))
>
> (reference:
> http://groups.google.com/group/clojure/browse_thread/thread/7d3ee57ee8041353
> )
>
> The error message was:
> Caused by: java.lang.IllegalArgumentException: Wrong number of args
> passed to: PersistentVector
>
> How many args were being passed anyway? The code looked fine (to me).
> It would have been helpful to me to know the number of args being
> passed was zero.
>
> With the patch below the error message would look like this:
>
> ... java.lang.IllegalArgumentException: Wrong number of args (0)
> passed to: PersistentVector ...
>
> The patch will handle all cases of wrong arity and report the expected
> number of args. In some cases (RestFN) the exception will now report
> the required arity as well as the given arity.
> ...
>

-- 
Patrick Steiger.

"Theory is when you know something, but it doesn't work. Practice is
when something works, but you don't know why.
Programmers combine theory and practice: Nothing works and they don't
know why." - Anon

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

Reply via email to