Hi, I'm trying to understand why this program throws an exception:
$ clojure -e "(clojure-version)" "1.0.0-" $ cat test1.clj (ns rw.test (:import (java.io StringReader))) (def x (with-open [s (-> (new StringReader "abc") (new clojure.lang.LineNumberingPushbackReader))] (binding [*in* s] (read)))) (println x) $ clojure test1.clj Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at jline.ConsoleRunner.main(Unknown Source) Caused by: java.lang.IllegalArgumentException: Unable to resolve classname: (new StringReader "abc") (test1.clj:4) whereas this one works without problems: $ clojure -e "(clojure-version)" "1.0.0-" $ cat test2.clj (ns rw.test (:import (java.io StringReader))) (def x (with-open [s (-> (StringReader. "abc") (clojure.lang.LineNumberingPushbackReader.))] (binding [*in* s] (read)))) (println x) $ clojure test2.clj abc I thougth that "StringReader." and "new StringReader" are equivalent, right? So why these programs work differently? Br, Rob --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---