Hello everybody, sometimes the error messages from the compiler can be quite cryptic. This is nothing serious or ground-breaking, but I thought maybe it would be a good idea if we got clojure to tell us which symbol is incorrect?
So I had a look at the code and it turns out this particular error message can be improved very easily. index e095ed0..24416c5 100644 --- a/src/jvm/clojure/lang/RT.java +++ b/src/jvm/clojure/lang/RT.java @@ -472,7 +472,12 @@ static ISeq seqFrom(Object coll){ else { Class c = coll.getClass(); Class sc = c.getSuperclass(); - throw new IllegalArgumentException("Don't know how to create ISeq from: " + c.getSimpleName()); + String msg = "Don't know how to create ISeq from: " + c.getSimpleName(); + if(coll instanceof Named) { + throw new IllegalArgumentException(msg + " (" + coll + ")"); + } else { + throw new IllegalArgumentException(msg); + } } } I don't think it would be a good idea to print out the coll in every case - after all, it might be some huge Java collection that somehow is not seq-able. But for java.lang.Named this should be quite safe. Discussion? Cheers, Juergen PS: I did fill out a CA. --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---