J3/15-101r1 To: J3 Subject: Wart removal proposal -- Specification expressions From: Van Snyder Date: 2015 February 24 Reerence: 15-007 1. Introduction =============== The question whether such things as integer :: B = bit_size(B) are permitted or prohibited has recently recurred on comp_lang_fortran. Interp F95/000090 (why did we have six-digit interp numbers?) included the above example, and several others, including character :: C(20)*(size(C,1)) The answer to the interp was that both of these declarations (and several additional examples) were intended to be illegal. This resulted in 7.1.11p8, which says, in part "The prior specification may be to the left of the specification inquiry in the same statement, but shall not be within the same ..." which is somewhat ambiguous: It is reasonable that the extents of an array might not be established before before a is examined, as in the second example, but certainly one knows the type and type parameters before processing any in the statement. I.e., is the bit size specified by the or the ? 2. Specification ================ Allow properties of an object to be referenced within its , provided the properties depend only upon the type and kind type parameters of the object. This would allow such things as integer :: B = bit_size(B) real :: E = sqrt(sqrt(epsilon(E))) 3. Syntax ========= The proposal is germane to R503 and R505 , but no syntax rules are changed. 4. Edits ======== [156:30 7.1.12p2] Append to end of the sentence: ", unless the specification inquiry appears within an and the properties depend only on the type and kind type parameters". 5. Alternative Specification ============================ Allow to reference any constant properties of an object within an within its . This would allow such things as integer :: Iota(10) = [ ( i, i = 1, size(iota,1) ) ] 6. Alternative syntax ===================== Same as above. 7. Alternative Edits ==================== [156:30 7.1.12p2] Append to the end of the sentence: ", unless the specification inquiry appears within an ."