J3/01-159r1 page 1 of 2 Date: 21 March 2001 To: J3 From: John Reid/Rich Bleikamp Subject: Interpretation 25 (List-directed input: types of variables corresponding to repeated values) Here is a draft answer for interp. 25. This was discussed at Oulu without reaching a resolution. WG5 commented as follows (WG5/N1410) Section 10.8 [175:7-9] states: "The r*c form is equivalent to r successive appearances of the constant c, and the r* form is equivalent to r successive appearances of the null value." WG5/interp was unable to agree on whether r*c implied r copies of the characters in c or r copies of the constant implied by c, possibly after the association of the first copy in the input record with its associated list item. Both interpretations are possible from the text. The answer to the question is accordingly no or yes. I have prepared a draft answer based on the first alternative, because I believe that this is what was intended and it is what most compilers do. - - End of John's comments - - - - Rich's comments - - JOR believes the 2nd alternative above is correct, and can be deduced from a careful reading of section 10.8. .................................................. NUMBER: 000025 TITLE: List-directed input: types of variables corresponding to repeated values KEYWORDS: DEFECT TYPE: Erratum STATUS: J3 consideration in progress QUESTION: When a repeat count is used in list-directed input, must all the variables into which the repeated value is read have the same type? I see no reason in the standard to assume that restriction, but at least one Fortran 90 implementation assumes it. J3/01-159r1 page 2 of 2 ANSWER: No, the variables are not required to be of the same type, but the type of the repeated constant is either a literal constant, or a nondelimited character constant, but not both (10.8, "where is a literal constant or a nondelimited character constant"). Whether certain forms of a repeated constant are treated as a literal constant or a nondelimited character constant is determined by the type of the first variable which consumes this value. Indeed, how many characters from the input record are part of is dependent on the type of the first variable which consumes a value from that . For example, the input 2*(1.0, 0.0) conforms to the standard when consumed by three list items of type character or by two list items of type complex. If there are three character variables, the first two get the value "(1.0", while the third gets the value "0.0)". If there are two complex variables, they both are assigned the value (1.0,0.0). Similarly, the input 2*.TRUE. can be consumed by two logical variables, or two character variables, but not by one character and one logical variable. An edit is provided to clarify the situation. EDIT: In section 10.8.1, add the following as a new paragraph, just before Note 10.26 [175:33+]. "For the form of an input value, the constant is interpreted as a nondelimited character constant if the first list item corresponding to this value is of type default character, there is a nonblank character immediately after , and that character is not an apostrophe or a quotation mark; otherwise, is interpreted as a literal constant." SUBMITTED BY: Robert Corbett HISTORY: 98-155 m145 Submitted (part 3) WG5/N1410 Draft answer