Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #13697

Re: terminology

From Lew <noone@lewscanon.com>
Newsgroups comp.lang.java.programmer
Subject Re: terminology
Date 2012-04-20 08:05 -0700
Organization albasani.net
Message-ID <jmru07$91b$1@news.albasani.net> (permalink)
References <terminology-20120420003700@ram.dialup.fu-berlin.de> <580829.126.1334881065985.JavaMail.geo-discussion-forums@pbcgs4> <jmqjhq$b7b$1@dont-email.me> <verbs-sentences-20120420062533@ram.dialup.fu-berlin.de>

Show all headers | View raw


On 04/19/2012 09:40 PM, Stefan Ram wrote:
> markspace<-@.>  writes:
>>>> java.lang.Thread     . dumpStack() java.lang.System.out . print( 2 )
>>>> I do call the source code part in front of the last dot a
>>>> /context/.
>>> Fully-qualified type name.
>> I'd have said the same off the top of my head.  I'd also call it a
>> "class" if FQN was a bit long, or I was being less strict in my speaking.
>
>    A »type name« is a special kind of context, it is a static context.
>    My usage does not come from the JLS, but from javac who says things like:
>
> Main.java:7: error: non-static method length() cannot be referenced from a static context
> String.length();
>        ^
> 1 error
>
>    When you teach java [sic], explaining vocabulary of javac can't be
>    that wrong, even if it's not as authoritative as the JLS.
>    Obviously, the »static context« above is »String«.

No. 'String' is the (simple) type name. The static context is the semantic 
space to the right of the dot.

>    I cannot call this »type name«, since the part in front of
>    the last dot is not always a type name, as in
>
> java.lang.System.out   . println()
>
>    . »java.lang.System.out« is the context of »println()«
>    (in my terms), but it is not a type name.

"Context" is a general term, and the javac output is using it exactly as the 
JLS does. Static contexts occur other than by a type name, e.g.,:

  public class Foo
  {
    static
    { // static context
    }
  }

There is nothing wrong with using these terms as the JLS does.

When you teach Java, the vocabulary of the JLS can't be wrong. (Well, there 
are questionable items in there, but that's another matter.) Trying to go 
against it, especially diametrically, can be.

More subtly, you misidentified the static context in the 'String' call to 
'length()'. "Context" is used in its ordinary, English sense in the JLS, and 
in the concomitant "javac" output. It means, in that example, that at the 
point of evaluation of the method name, that is, to the right of the dot, the 
semantic environment is that of the type specified by the type name to the 
left of the dot. By the rules of Java, since it's a type name and not an 
instance name, the context is static. Likewise in a static initializer, to 
between the braces is a static context. "Context" means the environment or 
ontological background - are we looking at the world from the class-wide 
(static) view or the instance view?

I aver that you're going about this backwards, thus impeding understanding of 
Java. Instead of trying to map your terms to what exists in Java, start with 
the Java terminology and grok what they really mean. Then, if you still really 
feel the need, come up with synonyms, rather than shoehorning alien concepts 
into the Java space.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: terminology Lew <lewbloch@gmail.com> - 2012-04-19 17:17 -0700
  Re: terminology markspace <-@.> - 2012-04-19 20:01 -0700
    Re: terminology Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-04-20 07:09 -0300
    Re: terminology Lew <noone@lewscanon.com> - 2012-04-20 08:05 -0700
    Re: terminology markspace <-@.> - 2012-04-20 11:03 -0700
    Re: "static context" Lew <noone@lewscanon.com> - 2012-04-21 04:15 -0700

csiph-web