-
Notifications
You must be signed in to change notification settings - Fork 272
Description
In https://clojure.org/reference/java_interop, one example given is:
(.instanceMember Classname args*)
I found that confusing, and it was discussed at https://groups.google.com/forum/#!topic/clojure/7eEpEOn1B28 that the docs here could be clarified. Colin Fleming notes:
This doc is confusing - as Phill comments above, this is calling the getName() method on an instance of Class. In Clojure, a bare classname (String, ArrayList or whatever) resolves to the class itself if it has been imported (i.e. what would be String.class in Java). The doc is confusing because
(.instanceMember Classname args*)
is really just a special case of(.instanceMember instance args*)
, where "instance" refers to an instance of a Class object. I'm not sure why that doc makes that distinction, it doesn't seem useful to me.