On Tue, Sep 1, 2009 at 10:40 AM, Rich Hickey <richhic...@gmail.com> wrote:
> On Mon, Aug 31, 2009 at 10:55 AM, Krukow<karl.kru...@gmail.com> wrote: > > > > I have two minor minor suggestions for Clojure changes. > > > > 1) Consider this function: > > user> (set! *warn-on-reflection* true) > > true > > user> (defn reader-from-classpath [s] > > (-> (.getResourceAsStream java.lang.String s) > > (java.io.InputStreamReader.) > > (java.io.BufferedReader.))) > > Reflection warning, NO_SOURCE_PATH:2 - call to getResourceAsStream > > can't be resolved. > > #'user/reader-from-classpath > > > > In general, I think every call of form (.instanceMember Classname > > args*) will generate such a warning since it expands to, e.g., > > > > user> (macroexpand ' (.getResourceAsStream java.lang.String s)) > > (. (clojure.core/identity java.lang.String) getResourceAsStream s) > > user> > > #1 is fine idea. I've implemented the hinting in the compiler where > that expansion takes place. (commit e45046da8f) > Why is there a call to identity at all? Why not just (. java.lang.String getResourceAsStream s)? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---