[J3] [EXTERNAL] [BULK] Re: Allowing generic names for actual procedure arguments?
Clune, Thomas L. (GSFC-6101)
thomas.l.clune at nasa.gov
Mon Nov 27 13:51:58 UTC 2023
Hi Van,
Catching up on my email after taking a week of vacation.
This thread was not intended to be anything about automatic instantiation. Yes, the Japanese feature does need to specify all types “in advance”, but the generic name can still be extended to include additional specific functions. My intent rather was to engage in discussions about extending the language to allow generic names to be used in more contexts (eg dummy arguments) when unambiguous.
* Tom
From: J3 <j3-bounces at mailman.j3-fortran.org> on behalf of j3 <j3 at mailman.j3-fortran.org>
Reply-To: j3 <j3 at mailman.j3-fortran.org>
Date: Monday, November 20, 2023 at 5:52 PM
To: j3 <j3 at mailman.j3-fortran.org>
Cc: Van Snyder <van.snyder at sbcglobal.net>
Subject: [EXTERNAL] [BULK] Re: [J3] Allowing generic names for actual procedure arguments?
CAUTION: This email originated from outside of NASA. Please take care when clicking links or opening attachments. Use the "Report Message" button to report suspicious messages to the NASA SOC.
On Mon, 2023-11-20 at 17:14 +0000, Clune, Thomas L. (GSFC-6101) via J3 wrote:
All,
Currently the standard requires actual procedure arguments to be specific names. When the corresponding dummy procedure has an implicit interface, this constraint is essential. However, I do not see any fundamental reason why one could not have generic resolution work in the case of dummy procedure arguments with explicit interfaces. Is this something that could be pursued?
Background: This issue ties into some of the discussion by generics subgroup regarding treatment of generic names in templates. E.g., it might be convenient, esp. in light of the Japanese proposal, to “automatically” promote specific names to generic names in templates. This is particularly appealing if the constraint mentioned above is weakened. It would also be natural to do this for module procedures. Early days, and we may well not have thought of all the gotchas.
One of the "gotchas" relating to generic procedures with generic type is that, with automatic instantiation, all of the types for which they are to be used must be accessible. Withe explicit instantiation, only the types mentioned in the instantiation need be accessible at the point of instantiation.
Cheers,
- Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20231127/26ab42ec/attachment-0001.htm>
More information about the J3
mailing list