J3/97-238r1 Date: 15 October 1997 To: J3 From: Larry Rolison Subject: Interpretation Request # 2 Free source form requirement for blank in PRINT statement NUMBER: 2 TITLE: Free source form requirement for blank in PRINT statement KEYWORDS: Free source form, PRINT, blank DEFECT TYPE: Interpretation STATUS: X3J3 consideration in progress QUESTION: Consider the following PRINT statement form: PRINT"(I5)",5 Section 3.3.1 of the Fortran 95 standard states: A blank shall be used to separate names, constants, or labels from adjacent keywords, names, constants, or labels. NOTE 3.3 For example, the blank[s] after ... READ ... [is] required in the following: ... READ 10 ... Although the sentence preceding R420 is somewhat confusing in that it uses the phrase "a sequence of characters, DELIMITED by either apostrophes or quotation marks", the syntax rule itself is clear that the " or ' delimiting characters are part of the syntax. The first sentence on the top of page 36 then clarifies that although the delimiter characters are a part of the syntax, they are not a part of the value. Section 3.2 makes it clear that a character literal constant is a token. Section 3.2.5 describes delimiters but does not include either " or ' because it is describing delimiters for lists. Thus, it seems clear that in free source form a blank is required between the keyword PRINT and the character literal constant containing the format list but there is also some disagreement on this point among existing Fortran processors. (1) In free source form, is a blank required between the keyword PRINT and the character literal constant containing the format specification? (2) Also, for clarification, in free source form, is a blank required between the keyword PRINT and the asterisk that represents the list-directed output specifier? ANSWER: (1) Yes. The analysis in the QUESTION is correct. Since PRINT is a keyword, when the format specification is a character literal constant, the blank is required between the keyword PRINT and the format specifier. (2) No. Since PRINT is a keyword, according to the cited rule in 3.3.1, the asterisk would have to be a name, a constant, or a label in order for a blank to be required to separate PRINT from the asterisk. By 3.2.1, an asterisk is not a name. By 3.2.2, an asterisk is not a constant. And by 3.2.4, an asterisk is not a statement label. Yes, an asterisk may be used as a dummy argument alternate return specifier representing a statement label but that usage is irrelevant to the PRINT statement. Therefore, since an asterisk is none of the three items that must be separated from PRINT by a blank, the blank is not required. EDITS: None. SUBMITTED BY: Larry Rolison / Dick Hendrickson HISTORY: J3/97-238 M143 submitted