[J3] Question about C767 in 21-007
Van Snyder
van.snyder at sbcglobal.net
Sat Oct 23 20:33:38 UTC 2021
On Sat, 2021-10-23 at 10:28 +0900, Malcolm Cohen via J3 wrote:
> I don’t see any obvious problem with the current wording. One cannot
> use colons for bounds/type-params of nonpointer components, so there
> is no problem with the coverage.
>
> However, pointer components may have type parameters that are
> expressions, and indeed non-constant expressions. So the current
> wording works for them too.
If one looks only at C767, on page 75, one might conclude that this
component declaration is allowed:
integer, X(:) = [ 1, 2, 3 ]
I agree that one can prove the theorem that it is prohibited by wider-
ranging research: C768, immediately next, R740, on page 72, then C834,
in a different clause, on page 106.
I also agree that there are numerous other situations where wide-
ranging research is necessary to prove such theorems.
Perhaps the standard would become too large if they were all spelt out
explicitly. And as Dick Hendrickson and Richard Maine observed many
years ago, if something is specified more than once, there is a good
chance it's wrong in more than one place, and the interp process to
correct it would be unreliable because there might be yet another
incorrect place.
Cross references consisting only of hyperlinked syntax rules and
constraints would be helpful. For example, if "see also R740 and C834"
were included, with hyperlinks, in C767, the required research would be
easy. It would be a lot of work to add these comprehensively, but they
could be added gradually without introducing technical change.
Maybe this is a job only for textbook writers.
=========================================================================
C767 says that if component-
initialization appears, every type parameter and array bound of the com
ponent shall be a colon or constant expression.
Does this need to be separated into two parts, one for pointer componen
ts --
where the bounds have to be colons, and one for nonpointer components
-- where the array bounds have to be constant expressions?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20211023/4a5ce61c/attachment.htm>
More information about the J3
mailing list