On Oct 3, 3:17 pm, Stuart Halloway <[EMAIL PROTECTED]> wrote:
> Thanks Stephen, Chouser, and Rich.
>
> Understanding the historical reason that (. SomeClass method) doesn't
> work, I would be in favor of the deprecation Rich mentioned, leading
> to (. SomeClass method) being able to work in the future.
>

(. SomeClass method) works - it just calls static methods. We're just
talking about limiting . to instance members, which would make it work
differently.

Many of the people who get stuck on this (not you Stuart) don't even
know the difference between static methods of SomeClass and instance
methods of Class - they presume all would be available with the same
syntax! I imagine lots of complaints to the effect of, why doesn't
this work anymore:

(. Integer parseInt "42")

The flipside is, the only additional methods that you could call if I
were to change this would be the instance methods of Class. Many of
them could be made much easier with some helper functions that wrap
reflection.

If I were to change this, we would lose any static member support in
macros that leverage the . op, like .. - i.e. no more:

(.. System out (println "Hello World"))

It would _have_ to be:

(.println System/out "Hello World") or (. System/out println "Hello
World")

I much prefer treating classnames as namespaces for static members
(i.e. the latter forms), but it won't be intuitive for those used to
ClassName.staticMethod() in Java.

That may be no big deal, I don't know. I guess with a deprecation
warning in place I'd find out soon enough :)

The original design was - if you say x.y() in Java, static or
instance, you can say (. x y) in Clojure, and that idea still has the
merits of being very easy to explain, and possibly the target of
mechanical transformations of Java code.

People just got spoiled by class object literals, and now we have this
alternative non-Java-like but snazzy static member syntax.

Still mulling...

Rich

--~--~---------~--~----~------------~-------~--~----~
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