From hiramhunt at verizon.net Fri Sep 2 21:33:33 2016 From: hiramhunt at verizon.net (Hiram Hunt) Date: Fri, 02 Sep 2016 17:33:33 -0400 Subject: Possible Typo in Section 15.27.3 Message-ID: <253f0ee0-a645-8ac2-0efe-b439829a3015@verizon.net> Hello, In JLS Java SE 8 Edition, in section 15.27.3 (Type of a Lambda Expression), the definition of "congruent" contains several bulleted items. One of these says "The number of lambda parameters is the same as the number of parameter types of the function type." Maybe "parameter types" should be just "parameters"? -- Hiram Hunt (hiramhunt at verizon.net) From alex.buckley at oracle.com Fri Sep 2 23:44:56 2016 From: alex.buckley at oracle.com (Alex Buckley) Date: Fri, 02 Sep 2016 16:44:56 -0700 Subject: Possible Typo in Section 15.27.3 In-Reply-To: <253f0ee0-a645-8ac2-0efe-b439829a3015@verizon.net> References: <253f0ee0-a645-8ac2-0efe-b439829a3015@verizon.net> Message-ID: <57CA0EF8.4040808@oracle.com> On 9/2/2016 2:33 PM, Hiram Hunt wrote: > In JLS Java SE 8 Edition, in section 15.27.3 > (Type of a Lambda Expression), the definition > of "congruent" contains several bulleted items. > One of these says > > "The number of lambda parameters is the same > as the number of parameter types of the > function type." > > Maybe "parameter types" should be just "parameters"? No, because a function type is defined in JLS8 9.9 to consist (among other things) of formal parameter types, not formal parameters. (I admit there is a mention of "formal parameters" in 9.9, but it's already corrected to "formal parameter types" in the master files.) Alex From alex.buckley at oracle.com Fri Sep 2 23:50:57 2016 From: alex.buckley at oracle.com (Alex Buckley) Date: Fri, 02 Sep 2016 16:50:57 -0700 Subject: 2.4 Grammar notation: examples look inconsistent In-Reply-To: References: Message-ID: <57CA1061.1040007@oracle.com> On 8/18/2016 4:27 PM, Dani?l p wrote: > *2.3. The Syntactic Grammar* says that > >> This grammar (the syntactic grammar) has *tokens defined by the lexical >> grammar as its terminal symbols*. > > *2.4. Grammar Notation* says that > >> *Terminal symbols are shown in fixed width** font* in the productions of >> the lexical and syntactic grammars. > > This is the example shown: > > For example, the syntactic production: > IfThenStatement: > if ( Expression ) Statement > > states that the nonterminal IfThenStatement represents the token if, > followed by a left parenthesis token, followed by an Expression, followed > by a right parenthesis token, followed by a Statement. > > So the *if*-keyword and the parentheses *()* are tokens (?3.5 > ), and > tokens are the terminal symbols of The Syntactic Grammer, and Terminal > symbols are shown in fixed width font. > Why are the tokens in this example and other examples in *italic* font > instead of just fixed with font, even if they are terminal symbols and not > nonterminal symbols in syntactic grammer? This is a limitation in the toolchain that renders the JLS in HTML. The PDF and the printed book have correct typography, with terminals in fixed width font. > *Final question:*Why is it if ( Expression ) Statement instead of if ( > Expression ) Statement? I can't tell the difference between these alternatives. Alex From hiramhunt at verizon.net Thu Sep 8 18:02:59 2016 From: hiramhunt at verizon.net (Hiram Hunt) Date: Thu, 08 Sep 2016 14:02:59 -0400 Subject: Possible Typo JLS8 Section 16.2.15 Message-ID: <10cb2ff1-033e-43ed-05ee-f883ded3cbad@verizon.net> Hello, In JLS8 Section 16.2.15 it says If a try statement does have a finally block, then these rules also apply: ? V is definitely assigned after the try statement iff at least one of the following is true: ? V is definitely assigned after the try block and V is definitely assigned after every catch block in the try statement. ? V is definitely assigned after the finally block. ? V is definitely unassigned after a try statement iff V is definitely unassigned after the finally block. Should the last item, which starts with a "-", instead start with a round bullet and be indented less to match the other round bullet items? Also, for consistency with the item that does have a round bullet above, should the last item be changed to say "the try statement" instead of "a try statement"? -- Hiram Hunt (hiramhunt at verizon.net) From alex.buckley at oracle.com Thu Sep 8 20:03:38 2016 From: alex.buckley at oracle.com (Alex Buckley) Date: Thu, 08 Sep 2016 13:03:38 -0700 Subject: Possible Typo JLS8 Section 16.2.15 In-Reply-To: <10cb2ff1-033e-43ed-05ee-f883ded3cbad@verizon.net> References: <10cb2ff1-033e-43ed-05ee-f883ded3cbad@verizon.net> Message-ID: <57D1C41A.7070703@oracle.com> Yes, you're right. This infelicity has been present since JLS2 reformulated the analysis of try statements. Many thanks. Alex On 9/8/2016 11:02 AM, Hiram Hunt wrote: > Hello, > > In JLS8 Section 16.2.15 it says > > If a try statement does have a finally block, then these rules also apply: > ? V is definitely assigned after the try statement iff at least one of > the following > is true: > ? V is definitely assigned after the try block and V is definitely > assigned after > every catch block in the try statement. > ? V is definitely assigned after the finally block. > ? V is definitely unassigned after a try statement iff V is > definitely unassigned > after the finally block. > > Should the last item, which starts with a "-", instead start > with a round bullet and be indented less to match the other > round bullet items? Also, for consistency with the item > that does have a round bullet above, should the last item > be changed to say "the try statement" instead of "a try statement"? > > -- Hiram Hunt (hiramhunt at verizon.net) >