J3/17-232 To: J3 From: Malcolm Cohen Subject: Comments 13, 14, and 15 Date: 2017 October 15 1. Introduction Comment 13 (US) complains at great length that the wording of implicit type declaration conflicts with the scope when some other attribute is explicitly declared. This complaint is well-founded, though the proposed fix is undesirable (incompatible change in semantics). Comment 14: The use of "inclusive scope" in the specified text seems problematic. This complaint seems to be a duplicate of comment 13. It further refers to paper 17-184, which describes the complaint of comment 13. Anyway, although one can agree that the specified text "seems problematic", the suggested fix remains undesirable. Comment 15 (GB): The sentence "The data entity is treated as if it ... declared in the host of that scope." is not needed and is inconsistent with the rest of the paragraph. Agreed. 2. Discussion The "specified" (problematic) text is this: The data entity is treated as if it were declared in an explicit type declaration; if the outermost inclusive scope in which it appears is not a type definition, it is declared in that scope, otherwise it is declared in the host of that scope." This follows a sentence much earlier in the paragraph which describes the effect of implicit typing on the type and type parameters. It is unclear why we are attempting to duplicate the scoping rules at this point in the standard. The scoping rules for local and construct entities are described elsewhere (clause 19), so attempting to describe them again here will at best be redundant, and is more likely to be contradictory. Furthermore, to say that it is treated as if it were declared "by an explicit type declaration" adds nothing; we've already said what the type and type parameters are. One might be tempted to do a "fixup" of the existing wording, but given the complications introduced not just by BLOCK but also by ASYNCHRONOUS and VOLATILE, the result would be very fragile (and a continuing source of problems if any further changes to our scoping rules were made). Therefore the recommendation is to accept the fix proposed by comment 15. 3. Edits to 17-007r2 (N2137) [121:6-8] 8.7 IMPLICIT statement, p4, Delete "The data entity is treated ... host of that scope.". {Do not say anything about the scope of the entity; that must already be specified elsewhere.} NON-RECOMMENDED ALTERNATIVE: [same place] same paragraph, same sentence, delete. [121:9+] Insert new paragraph "An entity whose type is implicitly declared is treated as if it were explicitly declared by a type declaration statement. If any attribute other than ASYNCHRONOUS or VOLATILE is explicitly declared, it is declared in the same scope as the statement that declared the attribute. Otherwise, if the outermost inclusive scope in which it appears is not a type definition, it is declared in that scope; otherwise it is declared in the host of that scope.". {Alternative repair, making it a separate paragraph because paragraph four is already long, and the rest of the paragraph does not depend on it.} ===END===