J3/98-243R1 Date: 14 Nov 1998 To: J3 From: R. Maine Subject: Edits for explicitly typed array constructors This paper proposes edits for explicitly typed array constructors. Specs and syntax were approved in paper J3/98-162, with option 1 (intrinsic assignment only for the assignment syntax). My records do not record whether the primary or alternate syntax of paper 98-162 was selected. The edits below implement the alternative syntax based on discussion with some implementors. The *ONLY* diference is inwhether the type-spec is before or after the "(/" (and if before, the "::" is omitted), so it would be trivial to change the edits. Subsequent to the approval of 98-162 specs, it was noticed that restricting the non-kind type parameters to be specification expressions made the facility largely useless for some of its major purposes. The same issue arose in explicitly typed allocations. The edits approved in 98-208r2 lay the background for solving this issue for both explicitly typed allocation and explicitly typed array constructors; the restrictions on the kinds of expressions allowed are moved elsewhere so that they apply only when they are relevant. Thus the restrictions don't need to be in the basic definitions of the array constructor. These edits are all relative to J3/98-007R3. In 4.6, array constructors [56:17] After "(/" insert "[ :: ]" [56:25] "Each" -> "If the is omitted, each" [56:25+] Add "Constraint: If specifies an intrinsic type, then each expression in the shall be of an intrinsic type that is compatable with intrinsic assignment to a variable of type as specified in table 7.9. Constraint: If specifies a derived type, then each expression in the shall be of the same derived type and shall have the same kind type parameter values. [BEGIN J3 NOTE] The following requirement is proposed to solve the ambiguity questioned in one of the f95 interps. This might be interpreted as invalidating some existing f90/f95 programs, but the validity of such programs under f90/f95 is not clear. Different f90/f95 compilers exhibit diferent behavior in this area. The requirement is not a constraint because it is not always checkable at compile time; this also alows those processors that currently allow the code in question to continue doing so as an extension. If this requirement is added, then it also makes sense to make the optional, allowing a natural syntax for a zero-sized constructor (which does have uses). The shall appear if the is of size zero. [BEGIN J3 NOTE] If is omitted, each expression in the shall have the same type and type parameters. The type and type parameters of the array constructor are those of the expressions. If appears, it specifies the type and type parameters of the array constructor. Each expression in the shall be compatible with intrinsic assignment to a variable of this type and type parameters. Each value is converted to the type and type parameters of the in accordance with the rules of intrinsic assignment (7.5.1.4)." [56:27-28] delete the para. [56:38] delete the line