Thanks for spotting these, Guy. All corrected.

Gavin

On 10 Apr 2022, at 03:45, Guy Steele 
<guy.ste...@oracle.com<mailto:guy.ste...@oracle.com>> wrote:

Nice work defining new terminology for Chapter 14.  Just a few nits:


14.11.1

A switch label is said to support a default if either it has a default label, 
or it has a case label with a default.

Maybe:

A switch label is said to support a default if either it has a default label, 
or it has a case label with a default case element.



Any variable that is used but not declared in a whenexpression must either be 
final or effectively final 
(4.12.4<https://docs.oracle.com/javase/specs/jls/se18/html/jls-4.html#jls-4.12.4>).

Make that:

Any variable that is used but not declared in a whenexpression must be either 
final or effectively final 
(4.12.4<https://docs.oracle.com/javase/specs/jls/se18/html/jls-4.html#jls-4.12.4>).




The switch block of a switch statement or a switch expression is switch 
compatible with the type of the selector expression, T, if all the switch 
labels in the switch block are switch compatible with T.

I suggest:

The switch block of a switch statement or a switch expression is switch 
compatible with the type of the selector expression, T, if every switch label 
in the switch block is switch compatible with T.

because the following sentence defines the phrase “a switch label is switch 
compatible with T “ rather than “(a set of) switch labels are switch compatible 
with T “.

(These are basic principles of the style of writing I tried to establish for 
JLS: (a) once you define a specific form for a technical phrase, stick as 
closely as possible to that form; (2) where possible, focus on a single item in 
preference to sets of items—this means that “every” is usually a more useful 
quantifier than “all”.)


[more to come? I’m too sleepy to continue reading right now]

—Guy


Reply via email to