JLS 3/e -- Lots Of Errors

  • Thread starter Lawrence D'Oliveiro
  • Start date
A

Arne Vajhøj

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.

That is a good thing for paper versions.

But Java was born in the hypertext age.

Arne
 
A

Arne Vajhøj

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

In fact it would be pretty bad to duplicate the information
from a maintenance perspective.

Arne
 
A

Arne Vajhøj

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

Why?

People that read the JLS should have read the Java API (and
a tutorial on Java).

Arne
 
A

Arne Vajhøj

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

Wise words.

May I suggest that you take that advice.

Arne
 
J

Joshua Cranmer

What does “<=†mean, again?

In which context? You seem to be striving very hard to explain to us why
the JLS is a bad spec by trying to test our knowledge on trivia.

If I may use your precious C++ spec as an example, then, please tell me
what the official output of this code should be:

#include <cstdint>
#include <iostream>

using namespace std;

int main() {
union {
int32_t a;
uint32_t b;
} obj;

std::cout << &obj.a == &obj.b << std::endl;
return 0;
}

The answer may surprise you.
 
L

Lawrence D'Oliveiro

6.6.2.1 Access to a protected Member
Let C be the class in which a protected member m is declared. Access is
permitted only within the body of a subclass S of C. In addition, if Id
denotes an instance field or instance method, then:
• If the access is by a qualified name Q .Id , where Q is an
ExpressionName, then the access is permitted if and only if the type
of the expression Q is S or a subclass of S .
• If the access is by a field access expression E .Id , where E is a
Primary expression, or by a method invocation expression E .Id(...),
where E is a Primary expression, then the access is permitted if and
only if the type of E is S or a subclass of S .

What exactly is the relevance of “Id†to “m� It seems like “Id†should be a
protected member, but nowhere does it say this.
 
L

Lawrence D'Oliveiro

Did you read the introductory matter?

That seems non-normative. In order to be normative, it needs to spell things
out in detail.
That reads to me as saying "We don't try to define the interface of
classes here, go read the Java API documentation."

You’ll notice that Float and Double are not mentioned in that list.
 
J

Joshua Cranmer

That seems non-normative. In order to be normative, it needs to spell things
out in detail.

It does not say that it is non-normative, so it is normative.
You’ll notice that Float and Double are not mentioned in that list.

What part of "Examples include" do you not understand?
 
J

Joshua Cranmer

In the context of the language specification we happen to be discussing.

Where it's used a few different times in different contexts. As I said,
what is the context, i.e., what is the exact, full clause that it is
being used in.
 
L

Lawrence D'Oliveiro

It does not say that it is non-normative, so it is normative.


What part of "Examples include" do you not understand?

The part it doesn’t explain.
 
L

Lawrence D'Oliveiro

Where it's used a few different times in different contexts. As I said,
what is the context, i.e., what is the exact, full clause that it is
being used in.

The one I quoted right at the start of this thread.
 
A

Arne Vajhøj

What, the whole thing? It's tens of megabytes of text. The Encyclopedia
Brittanica is a shorter English-language work.

The commonly encountered classes in java.lang and java.util and java.io,
yes, though. String, System, the boxed primitive classes, StringBuilder,
Iterator, Set, Map, List, HashFoo, ArrayList, InputStream, OutputStream,
Reader, Writer, and File; and Exception; at the very least.

Having read the most common part and learned to lookup the
less common parts very quickly.

That accumulates knowledge over time.

Arne
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top