[J3] Generics and internal procedures
Malcolm Cohen
malcolm at nag-j.co.jp
Fri Aug 10 20:40:29 EDT 2018
Hi Jon,
Without checking through old documents, my belief is that we deliberately deleted the constraint so as to allow internal procedures in generic interfaces. This was part of the whole “use internal procedures as actual arguments etc.” feature.
That there is normative text that omits them would appear to be an oversight. This should be fixed.
(Of course someone has to go back to the paper that deleted the constraint and check that that is indeed what we thought we were doing. Which I am not going to do on a Saturday morning.)
Cheers,
From: Steidel, Jon L via J3
Sent: Saturday, August 11, 2018 3:56 AM
To: General J3 interest list
Cc: Steidel, Jon L
Subject: [J3] Generics and internal procedures
In F2003, clause 12.3.2.1 Interface block, we had constraint C1207 pertaining to a procedure statement in a generic interface block:
“A procedure-name shall have an explicit interface and shall refer to an accessible procedure pointer,
external procedure, dummy procedure, or module procedure.”
This constraint disappeared in F2008, but in a reorganized clause 12, section 12.4.3.4.1 Generic identifiers the following normative text appears in paragraph 1:
“A generic interface block specifies a generic interface for each of the procedures in the interface block. The PROCEDURE statement lists
procedure pointers, external procedures, dummy procedures, or module procedures that have this generic interface. …”
F2018 has no constraint, but has the same normative text as F2008.
The constraint and the normative text both prohibit internal procedures in a generic interface. All three standards have a constraint on the procedure statement
in a generic interface block stating
“A procedure-name shall be a nonintrinsic procedure that has an explicit interface.”
An internal procedure has an explicit interface.
So I have two questions. 1) Why do we disallow internal procedures in a generic interface? 2) Why was the constraint requiring diagnosis of an internal procedure in a generic interface removed?
Some compilers I’ve tried allow an internal procedure in a generic interface, and produce the expected results, while others continue to diagnose this as an error.
I find it odd that we’d actually remove a constraint unless we intended to allow something which was previously prohibited J.
-jon
Disclaimer
The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. Please see our 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/20180811/b7d662b9/attachment-0001.html>
More information about the J3
mailing list