[J3] Question about C767 in 21-007

Malcolm Cohen malcolm at nag-j.co.jp
Sat Oct 23 01:28:11 UTC 2021


Hi Van,

 

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.

 

ASIDE: If we had had deferred type parameters back in Fortran 90, there might have been a debate as to whether to require length type parameters of allocatable/pointer to be deferred. But we didn’t so there wasn’t. Prior to Fortran 2003, length type parameters (always CHARACTER length) were either constant expressions (the only possibility for components), non-constant expressions, or assumed.

 

Thus to split this constraint up into pieces that don’t overlap and don’t apparently-permit things that are excluded elsewhere, we would need at least three constraints: one for nonpointer components, one for array bounds of pointer components, and one for type parameters of pointer components.

 

That seems more likely to confuse than the simplistic one we currently have.

 

Cheers,

-- 

..............Malcolm Cohen, NAG Oxford/Tokyo.

 

From: J3 <j3-bounces at mailman.j3-fortran.org> On Behalf Of Van Snyder via J3
Sent: Friday, October 22, 2021 8:28 AM
To: j3 <j3 at j3-fortran.org>
Cc: Van Snyder <van.snyder at sbcglobal.net>
Subject: [J3] Question about C767 in 21-007

 

C767 says that if component-initialization appears, every type parameter and array bound of the component shall be a colon or constant expression.

 

Does this need to be separated into two parts, one for pointer components -- where the bounds have to be colons, and one for nonpointer components -- where the array bounds have to be constant expressions?

 

Is there a constraint somewhere else that covers this? I couldn't find one in 7.5.4.6.

 

 

Disclaimer

The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: 30 St. Giles, Oxford, OX1 3LE, United Kingdom. Please see our Privacy Notice <https://www.nag.co.uk/content/privacy-notice>  for information on how we process personal data and for details of how to stop or limit communications from us.

This e-mail has been scanned for all viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20211023/708059d7/attachment.htm>


More information about the J3 mailing list