(j3.2006) (SC22WG5.5148) WG5 letter ballot on draft Corrigendum 3
John Reid
John.Reid
Fri Dec 13 10:07:54 EST 2013
3) No, for the following reasons.
F08/0086 should be revised to the new version from Malcolm Cohen that is
attached.
I will change my vote to yes if the corrigendum is changed accordingly
or if the edits from F08/0086 are removed.
........................................................................
Now with my convener's hat on, I think we need to extend the deadline
for the vote to let people have more time to consider this revised
document. Let's give ourselves an extra week and change the deadline to
9 a.m. (UK time) on December 21, 2013.
Cheers,
John.
-------------- next part --------------
----------------------------------------------------------------------
NUMBER: F08/0086
TITLE: Implied-shape and separate PARAMETER statement
KEYWORDS: Implied-shape, PARAMETER
DEFECT TYPE: Erratum
STATUS: Unknown
QUESTION:
Q1. Consider
Program test1
Character(*) a,b(*)
Dimension c(*)
Parameter (a='123', b=['1','2','3'])
Character(*),Parameter :: c = [ '44','55','66' ]
Print *,a,b,c
End
The definition of the assumed-length character named constant A
conforms to Fortran 77 to Fortran 2008. However, the definition of
the implied-shape named constant B appears not to conform to Fortran
2008, as the standard says in 5.4.11p2
"A named array constant defined by a PARAMETER statement shall have
its shape specified in a prior specification statement."
On the other hand, the named constant C does not have such a
requirement, so its definition would appear to be conforming.
This apparent requirement on the named constant B would thus appear to
be inconsistent with those on the named constant C, as well as
inconsistent with the way that assumed length works, and with the
general principle of allowing attributes to be specified either in a
single type declaration statement or with separate specification
statements.
Is the program intended to conform to the Fortran standard?
Q2. Consider
Subroutine test2(a)
Real,Dimension(*) :: a,c
Parameter (c = [ 45.6 ])
a(:size(c)) = c
End Subroutine
The <array-spec> in the type declaration statement is ambiguous; if it
is an <implied-shape-spec> then the declaration of A as an
assumed-size array is erroneous, but if it is an <assumed-size-spec>
then the declaration of C as an implied-shape array is erroneous.
Is this program-unit intended to be standard-conforming?
ANSWER:
A1. Yes, the program was intended to conform to the Fortran standard.
An edit is provided to modify the requirement for prior
specification so as to allow this case.
A2. Yes, the program is intended to conform to the Fortran standard.
An edit is provided to add syntax to permit this unambiguously.
EDITS to 10-007r1:
[94:10] 5.3.8.1, R515,
Change "<implied-shape-spec-list>" to "<implied-shape-spec>".
{This will be the unambiguous implied-shape syntax.}
[94:10+] Insert new production
"<<or>> <implied-shape-or-assumed-size-spec>".
{This will be the otherwise-ambiguous syntax.}
[95:32] 5.3.8.5p1
Replace sentence
"An assumed-size array is declared with an <assumed-size-spec>."
with
"A dummy argument is declared to be an assumed-size array by an
<assumed-size-spec> or an <implied-shape-or-assumed-size-spec>."
{Now two ways of declaring assumed size.}
[95:33-] Insert new BNF term
"R520a <assumed-implied-spec> <<is>> [ <lower-bound> : ] *"
[95:33] R521 <assumed-size-spec>, after "<<is>>"
Replace entire RHS
"[ <explicit-shape-spec>, ]... [ <lower-bound> : ] *"
with
"<explicit-shape-spec-list>, <assumed-implied-spec>"
{The unambiguous case has a list of <explicit-shape-spec>s.}
[95:37+] Insert new BNF rules and constraint
"R521a <implied-shape-or-assumed-size-spec> <<is>>
<assumed-implied-spec>
C534a An object whose array bounds are specified by an
<implied-shape-or-assumed-size-spec> shall be a dummy data
object or a named constant."
{The otherwise-ambiguous case. Note careful wording.}
[96:24-25] 5.3.8.6p1
Replace sentence
"An implied-shape array is declared... <implied-shape-spec-list>."
with
"A named constant is declared to be an implied-shape array with an
<array-spec> that is an <implied-shape-or-assumed-size-spec> or
an <implied-shape-spec>."
{Now two ways of declaring implied shape.}
[96:26] R522,
Replace right-hand-side (after "<<is>>")
"[ <lower-bound> : ] *"
with
"<assumed-implied-spec>, <assumed-implied-spec-list>".
{This is now the unambiguously implied-shape spec.}
[96:28] p2,
Change "<implied-shape-spec>s" -> "<assumed-implied-spec>s"
and "the <implied-shape-spec-list>" -> "its <array-spec>",
making the entire paragraph read:
"The rank of an implied-shape array is the number of
<assumed-implied-spec>s in its <array-spec>."
{Change rank determination to accord with new syntax term.}
[107:11] 5.4.11p1 "shape" -> "rank".
{In the PARAMETER statement, only require the rank to be specified in
a prior specification statement.}
NOTE for future investigation:
The current wording of C533 is slightly defective, as it does not
clearly prohibit "REAL,DIMENSION(*) :: dummy,nondummy", seeing as
how that does indeed declare "the array bounds of a dummy data
object". C533 should probably be reworded similarly to C534a.
SUBMITTED BY: Bill Long
HISTORY: 12-191 m199 F08/0086 submitted - revised by Malcolm
Cohen - passed by J3 meeting
13-237 m200 Failed letter ballot
13-235 m200 Revised with straw votes
13-235r1 m200 Passed by J3 meeting
13-262 m201 Passed as amended by J3 letter ballot #28
13-255r1
N1990 m202 Passed by WG5 ballot N1988/n1987
something ???? Revised edits from draft corrigendum ballot
----------------------------------------------------------------------
More information about the J3
mailing list