To: J3 J3/20-126
From: Van Snyder
Subject: Rank-agnostic allocation and pointer assignment -- Edits
Date: 2020-February-27
References: 18-247 19-110r1 19-150 19-173r1 20-120
[Introduction Data usage and computation]
"o Arrays can be used to specify the bounds of a deferred-shape array
when it is allocated.
o Arrays can be used to specify the bounds of a pointer during
rank-remapping pointer assignment.
0 An array can be used to specify the lower bounds of a pointer during
pointer assignment.
"
1. Edits for rank-agnostic allocation
=====================================
[132:14+ 9.7.1.1 Form of the ALLOCATE statement R932 ]
Insert an alternative
" <> ( [ : ]
\smudge
[ ] )
"
[132:18+ 9.7.1.1 Form of the ALLOCATE statement R934 ]
Insert a syntax rule
R934a <>
[132:19+ 9.7.1.1 Form of the ALLOCATE statement R935 ]
Insert a syntax rule
R934a <>
[133:7+ 9.7.1.1 Form of the ALLOCATE statement C942+] Insert a
constraint:
"C942a (R932)If does not appear,
shall be a rank-one array of constant size equal to the rank of
. Otherwise at least one of
and shall be a rank-one array of constant
size equal to the rank of .
"
{The syntax rule number in the constraint is important because the
syntax terms and are used for
pointer assignment, where different constraints are needed.}
[134:9+ 9.7.1.2 Execution of an ALLOCATE statement p1+] Insert a
paragraph:
"When an ALLOCATE statement is executed for an array in which
is specified, it specifies the upper bounds for the
dimensions of the array. Subsequent redefinition or undefinition of an
entity in a bounds expression does not affect the array bounds. If
appears, it specifies the lower bounds; otherwise
the default value is one. If or
is scalar, the effect is as if it were broadcast to the shape of the
other. If any element of is less than the
corresponding element of , the extent in the
corresponding dimension is zero and the array has zero size."
2. Edits for rank-agnostic pointer rank remapping
=================================================
[164:27+ 10.2.2.2 Syntax of the pointer assignment statement R1033
] Insert an alternative between the second
and third right-hand sides:
" <> ( :
) =>
"
[165:6+ 10.2.2.2 Syntax of the pointer assignment statement C1019+]
Insert a constraint
"C1019a (R1033) At least one of or
shall be a rank-one array of constant size
equal to the rank of . If one of them is a
scalar, the effect is as if it were broadcast to the same shape
as the other.
"
{The syntax rule number in the constraint is important because the
syntax terms and are used for
allocation, where different constraits are needed.}
[166:27-32 10.2.2.3 Data pointer assignment p9] Replace the paragraph.
"If and appear, each element of
specifies the lower bound for the corresponding
dimension of
specifies the upper bound for the corresponding dimension of
is
less than the corresponding element of , the extent
in the corresponding dimension is zero and the array has zero size. The
number of elements of the data target shall not be less than the
number implied by and . The
elements of the pointer object are associated with those of the data
target, in array element order. If the data target has more elements
than implied by and , the
remaining elements are not associated with the pointer object.
If appears, the effect is as if each
were the corresponding element of
, and each were the corresponding
element of ."
3. Edits for rank-agnostic specification of pointer lower bounds
================================================================
[164:26+ 10.2.2.2 Syntax of the pointer assignment statement R1033
] Insert an alternative between the first
and second right-hand sides:
" <> ( : ) \smudge
\smudge
"
[165:2+ 10.2.2.2 Syntax of the pointer assignment statement C1017+]
Insert a constraint
"C1017a (R1033) shall be a rank-one array of
constant size equal to the rank of .
"
[166:34 10.2.2.2 Syntax of the pointer assignment statement p10] replace
"If " with "If or
appears".