Re: "static" prefix - to parallel "this" prefix

From: Tim Tyler (tim_at_tt1lock.org)
Date: 12/06/04


Date: Mon, 6 Dec 2004 15:21:03 GMT

Chris Uppal <chris.uppal@metagnostic.remove-this.org> wrote or quoted:
> Tim Tyler wrote:

> > Suggested syntax would be "static.var" and "static.method()" -
> > instead of today's "ClassName.var" and "ClassName.method()".
> [...]
> > Has this been suggested before?
> >
> > Does it make sense to you?
> >
> > Are there any other proposals to deal with the same issue?
>
> Yes, yes, and yes, respectively ;-)
>
> Alex Hunsley posted a similar suggestion (maybe identical) a few months ago;
> see this thread (sorry about the URL, but it seems that Google is in the
> process of switching how the Google groups work):
>
> http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4ceda7465055571c
>
> (in case the URL stops working, the thread's title is "Good idea or full it
> it?")
>
> Personally, I like the idea but think it would work still better with a
> different keyword such as 'thisClass', see my post in the above thread for
> details.

The idea of eliminating constructor names is appealing.

However, I'm not sure what syntax would be best for that.

About the only alternative I considered for "static." was "class.".

It would *have* to be an existing keyword (or a symbol?) - unless you were
prepared for name clashes with identifiers in existing code.

I also think that "this." should be available to refer to static
data within static methods - and that there should be a corresponding
static object associated with the class that is accessible to the
programmer - i.e. that Java should behave more like smalltalk,
with everything being an object - and having a "this" reference.

However that would result in much more major surgery - and Java
probably has too much inertia for that sort of surgery to be
practical at this late date.

-- 
__________
 |im |yler  http://timtyler.org/  tim@tt1lock.org  Remove lock to reply.


Relevant Pages

  • Re: Remove SpyFalcon
    ... It is suggested that you execute each tool in Normal Mode then in Safe Mode. ... If you are using any version of Sun Java that is prior to JRE Version 5.0, ... NO, I have also tried all of your suggestion, and the suggestions on ... only 8 early in the infection. ...
    (alt.comp.anti-virus)
  • Re: "Your computer has been infected with malware" windows update
    ... I removed the other version of Java Runtime per your suggestion. ... >> If you are using any version of Sun Java that is prior to JRE Version ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Cheap/Free Patch Librarian Wanted
    ... guessed) so if you've got any suggestion on requirements etc it would ... The Multi patches are an interesting one. ... and fun to do. ... work with has written one for a Yamaha EX5 in Java. ...
    (rec.music.makers.synth)
  • Re: java PATH
    ... > Suggestion: Try either uninstalling the old version of java or changing ...
    (comp.os.linux.misc)