Hello,

Attached is a patch to give a little more information
for "java.lang.IllegalArgumentException: Don't know how
to create ISeq from:" error.

The current behavior is:
    user=> (map identity 1)
    java.lang.IllegalArgumentException: Don't know how to create ISeq
from: Integer
    java.lang.IllegalArgumentException: Don't know how to create ISeq
from: Integer
    ......... snipped ........

with patch:
    user=> (map identity 1)
    java.lang.IllegalArgumentException: Don't know how to create ISeq
from: Integer : 1
    java.lang.IllegalArgumentException: Don't know how to create ISeq
from: Integer : 1
    ............ snipped ............

I found it a helpful to understand macro expansion errors
better:

    user=> (macroexpand '(field-write-priv x :c 20 (vector :a :b)))
    java.lang.IllegalArgumentException: Don't know how to create ISeq
from: Symbol : G__2867
    java.lang.RuntimeException: java.lang.IllegalArgumentException:
Don't know how to create ISeq from: Symbol : G__2867
            at clojure.lang.LazyCons.rest(LazyCons.java:63)
            at clojure.lang.RT.printInnerSeq(RT.java:1320)
            ....... snipped ..........
            at clojure.lang.RT.print(RT.java:1173)
            at clojure.lang.Repl.main(Repl.java:76)
    Caused by: java.lang.IllegalArgumentException: Don't know how to
create ISeq from: Symbol : G__2867
            at clojure.lang.RT.seqFrom(RT.java:461)
            ....... snipped ..........
            at clojure.lang.LazyCons.rest(LazyCons.java:59)
            ... 11 more
    (let* [G__2867 (vector :a :b)] (if (clojure.contrib.pred/empty?
G__2867) (clojure/list (quote clojure/assoc) x :c 20) (user/field-
write-priv x (clojure/last G__2867) (clojure/list (quote clojure/
assoc) (clojure/-> xuser=>     java.lang.IllegalArgumentException:
Don't know how to create ISeq from: Symbol : G__2716

I am not a Java or Clojure expert so there may be a
better way to do this.  Patch follows.

Parth


[parth:~/src/clojure/src/jvm/clojure/lang]% svn update
At revision 1006.
[parth:~/src/clojure/src/jvm/clojure/lang]% svn diff RT.java
Index: RT.java
===================================================================
--- RT.java     (revision 1006)
+++ RT.java     (working copy)
@@ -458,7 +458,7 @@
 //     else if(coll instanceof Enumeration)
 //             return EnumerationSeq.create(((Enumeration) coll));
        else
-               throw new IllegalArgumentException("Don't know how to
create ISeq from: " + coll.getClass().getSimpleName());
+               throw new IllegalArgumentException("Don't know how to
create ISeq from: " + coll.getClass().getSimpleName() + " : " +
coll.toString());
 }

 static public ISeq keys(Object coll){
[parth:~/src/clojure/src/jvm/clojure/lang]%

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to