JLS 3/e -- Lots Of Errors

  • Thread starter Lawrence D'Oliveiro
  • Start date
L

Lawrence D'Oliveiro

It represents precisely and exactly what this sentence:

"A type argument TA1 is said to contain another type argument TA2,
written TA2 <= TA1, if the set of types denoted by TA2 is provably a
subset of the set of types denoted by TA1"

So look again at the two relations I quoted above, and see how the
definition you quoted is consistent with one of them, but not the other.
Hint: go and look up the meaning of “extends†if you have to.
 
L

Lew

So look again at the two relations I quoted above, and see how the
definition you quoted is consistent with one of them, but not the other.
Hint: go and look up the meaning of “extends†if you have to.

Look, let's try this one more time. Both are true. T is a type that fits
within T as an upper bound. T is also a type for which T is a lower bound.
Therefore "T <= ? extends T" *and* "T <= ? super T", since 'T' satisfies both
conditions.

--
Lew
Ceci n'est pas une fenêtre.
..___________.
|###] | [###|
|##/ | *\##|
|#/ * | \#|
|#----|----#|
|| | * ||
|o * | o|
|_____|_____|
|===========|
 
L

Lew

You haven’t actually read the languge spec, have you?

Yes, I have. Many times. My explanation was correct. You are a troll. Plonk.

--
Lew
Ceci n'est pas une fenêtre.
..___________.
|###] | [###|
|##/ | *\##|
|#/ * | \#|
|#----|----#|
|| | * ||
|o * | o|
|_____|_____|
|===========|
 
L

Lew

Lawrence said:
A word of advice: it is better to shut your mouth and be thought a fool,
than to open it and remove all doubt.

Then clearly you should have kept quiet, "Lawrence".

--
Lew
Ceci n'est pas une fenêtre.
..___________.
|###] | [###|
|##/ | *\##|
|#/ * | \#|
|#----|----#|
|| | * ||
|o * | o|
|_____|_____|
|===========|
 
A

Arved Sandstrom

So look again at the two relations I quoted above, and see how the
definition you quoted is consistent with one of them, but not the other.
Hint: go and look up the meaning of “extends†if you have to.

I'm cool with "extends" in wildcards, I use it often enough. Perhaps you
should explain what you believe the problem to be.

AHS
 
J

javax.swing.JSnarker

You haven’t actually read the languge spec, have you?

This is LEW we're talking about. Every other word he posts is a
quotation from the JLS. He sleeps with a dog-eared copy of the JLS under
his pillow. It's probably what he masturbates to.

And though he sometimes loses patience with those of us that don't have
it memorized backwards and forwards, his JLS-informed advice in this
newsgroup is frequently useful.

--
 
L

Lew

javax.swing.JSnarker said:
This is LEW we're talking about. Every other word he posts is a quotation from
the JLS. He sleeps with a dog-eared copy of the JLS under his pillow. It's
probably what he masturbates to.

Well, isn't that special?

I suppose you thought that was pretty clever when you wrote it.

http://en.wikipedia.org/wiki/Psychological_projection
And though he sometimes loses patience with those of us that don't have it
memorized backwards and forwards, his JLS-informed advice in this newsgroup is
frequently useful.

One of the reasons I reread the JLS so often is that I don't memorize it, and
some of the passages are a bit thick. As for my citations, that doesn't
require any special skill. You just see a question about Java syntax or
semantics, and you think to yourself, "Hey, let's see what the JLS says about
that!" Then you look it up. That'll make you an instant expert on most of
those questions.

As for "Lawrence"'s remark, it is quite clear that evidence or reason for it
were not foremost in his mind. He ain't nothin' but a hound dog. He ain't
never caught a rabbit, and he ain't no friend of mine.

--
Lew
Ceci n'est pas une fenêtre.
..___________.
|###] | [###|
|##/ | *\##|
|#/ * | \#|
|#----|----#|
|| | * ||
|o * | o|
|_____|_____|
|===========|
 
J

javax.swing.JSnarker

Well, isn't that special?

I suppose you thought that was pretty clever when you wrote it.

http://en.wikipedia.org/wiki/Psychological_projection

Gee, you rebut his opponent and somewhat compliment the guy, and this is
the thanks you get?

:p
As for "Lawrence"'s remark, it is quite clear that evidence or reason
for it were not foremost in his mind.

With you so far, but ...
He ain't nothin' but a hound dog.
He ain't never caught a rabbit, and he ain't no friend of mine.

This seems to be a complete non sequitur. Except maybe for that last part.

Maybe someone needs to smack Lawrence upside the head with a bound and
printed copy of the JLS.

--
 
L

Lawrence D'Oliveiro

Section 15.8.2, page 421: “The type of a class literal, C.Class†should be
“The type of a class literal, C.classâ€.
 
L

Lawrence D'Oliveiro

There are several constructs and terms that are used before they are
defined, without any reference to where the definition may be found.

For example, “strictfp†is first used in section 5.1.2, page 81, with no
reference to where it is defined.

The “<:†operator first occurs in section 4.5, page 51. There is no hint as
to what it means until you get to page 55.

Section 4, page 34:

Type arguments and type variables (§4.4) are not reified at run-time.

But reification is not explained until section 4.7, page 56.

Section 4.3.2, page 48:

The type of a method invocation e.getClass(), where the expression e has
the static type T, is Class<? extends |T|>.

The |T| notation is not explained until section 4.6, page 56, where it turns
out it denotes erasure.

Section 6.3.1, page 119: “type-import-on-demand†and “static-import-on-
demand†are not defined yet. No hint is given until page 127 that “static-
import-on-demand†is defined in §7.5.4. Similarly no reference for “type-
import-on-demand†is given until page 130, where it seems it comes from
§7.5.2.

It should be the job of an editor to catch this sort of thing.
 
L

Lawrence D'Oliveiro

Patricia said:
This raises an interesting issue. If one assumes sequential reading,
each term absolutely must be defined no later than its first use,
because it will not be possible to jump to a later definition.

You don’t have to assume sequential reading. It’s usual in language specs to
provide a reference for terms like that everywhere they occur outside their
defining section, whether before or after.
In practice, I don't think I have ever read a language specification the
way one reads a novel, beginning at the first page and continuing
sequentially to the end.

It’s how I do it the first time. Then later I come back to refer to things
as I need them.

(Though I have to admit the Annotated Ada Reference Manual left me feeling
like my brain had turned to mush. Maybe I’ll try the un-annotated version
next time...)
 
L

Lawrence D'Oliveiro

It's a method with a generic parameter that executes an infinite loop
using recursion. What doesn't make sense about it?

Hint: try it in an actual compiler.
 
L

Lawrence D'Oliveiro

This is LEW we're talking about. Every other word he posts is a
quotation from the JLS. He sleeps with a dog-eared copy of the JLS under
his pillow. It's probably what he masturbates to.

Really? Then he would know how the language spec uses the word “descendantâ€.
 
L

Lawrence D'Oliveiro

Section 5.2, page 99:

• The value of pvec cannot be assigned to cpvec, because not every
reference that could be the value of an expression of type
ColoredPoint can correctly be the value of a variable of type Point.

“ColoredPoint†and “Point†should be swapped.
 
L

Lawrence D'Oliveiro

Page 133: “a type name is always qualified by mea[ns] of another type nameâ€.

But that contradicts the case of simple type names defined in section
6.5.5.1 just above.
 
L

Lawrence D'Oliveiro

Why should it mention it? That is what the documentation on the
respective classes in the Java Standard API is for.

If that’s the case, there should be a reference to where it’s properly
defined.
 
J

Joshua Cranmer

If that’s the case, there should be a reference to where it’s
properly defined.

Did you read the introductory matter?
As noted above, this specification often refers to classes of the
Java and Java 2 platforms. In particular, some classes have a special
relationship with the Java programming language. Examples include
classes such as Object, Class, ClassLoader, String, Thread, and the
classes and interfaces in package java.lang.reflect, among others.
The language definition constrains the behavior of these classes and
interfaces, but this document does not provide a complete
specification for them. The reader is referred to other parts of the
Java platform specification for such detailed API specifications.

That reads to me as saying "We don't try to define the interface of
classes here, go read the Java API documentation."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top