[43] in java-interest

home help back first fref pref prev next nref lref last post

vm spec error and importing

daemon@ATHENA.MIT.EDU (Jeremy Fitzhardinge)
Thu May 4 12:34:47 1995

From: jeremy@sour.sw.oz.au (Jeremy Fitzhardinge)
To: java-interest@java.Eng.Sun.COM
Date: Thu, 4 May 1995 18:11:55 +1000 (EST)

In the VM spec, in the section on the format of the constant pool,
it has a table with the values of CONTSTANT_*.  However, it doesn't
list CONSTANT_Unicode which it mentions in the discussion below.
I guessed its value is 2, because that's a gap in the table, and
a look at oobj.h in the runtime include files confirms this.  Is
there any reason for the random formatting of the table?

If you do "import some.pkg.*", does the compiler look through
CLASSPATH and find the first directory mapping to some.pkg and
import all the classes in that, or does it import every class in
every some/pkg directory in CLASSPATH?  What if you import the same
class twice?  If it imports the union of all some/pkg directories
in CLASSPATH, what happens if it finds multiple implementations
for a particular class?

What classes are implicitly imported, if any?  I assume that
java.lang.Object and java.lang.String are, but is the whole
of java.lang.* implicitly imported?  Anything else?

The language spec talks about the operators abs(), max() and
min() in 7.1, Operators.  I notice that java.lang.Math defines
these as methods, so I wonder if they are really considered to be
part of the language or as part of the library (that is, are they
really "operators" or methods in the standard library?).  Is it
legal to just have

import java.lang.Math;
// ...
	int i = min(int1, int2);

or do you have to say

	int i = Math.min(int1, int2);?

If they are operators, are they keywords?  If so, it would make
java.lang.Math hard to compile, unless there's some special rules
about method names and reserved words...

Also, it doesn't actually describe what they do.  Sure, they have
descriptive enough names, from which you can guess their operation,
but all the spec says about their semantics is that "The operators
abs(x), max(x,y), and min(x,y) work for integers as they do for
all numbers" (ditto for floats), and there's no fallback on the C
standard.  The class API doc doesn't say what Math.abs() etc do
either.

Thanks,
	J

-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post