[J3] restricted specifics
Malcolm Cohen
malcolm at nag-j.co.jp
Tue Oct 6 00:27:46 EDT 2020
Actually, the restricted specifics cannot be passed as actual arguments.
So is there a language difference? I used to think there was, but now I can’t think of one...
(Maybe a long time ago I thought it meant one couldn’t have one’s own specific of that name in the generic, but now I think that the general permission to override intrinsics means that one can.)
Cheers,
--
..............Malcolm Cohen, NAG Oxford/Tokyo.
From: J3 <j3-bounces at mailman.j3-fortran.org> On Behalf Of Kurt W Hirchert via J3
Sent: Tuesday, October 6, 2020 7:57 AM
To: Robert Corbett via J3 <j3 at mailman.j3-fortran.org>
Cc: Kurt W Hirchert <kurthirchert at gmail.com>
Subject: Re: [J3] restricted specifics
On 10/5/2020 5:28 PM, Robert Corbett via J3 wrote:
Table 16.3 lists a set of restricted specific functions.
Some of the specific functions have the same names as
the corresponding generic functions, namely CHAR, ICHAR,
INT, LGE, LGT, LLE, LLT, AND REAL. Is there a way to
access these specific functions? Would the language be
changed if they were not available as specific
functions?
The definition of REAL is probably a mistake. In
FORTRAN 66, the REAL instrinsic was the complement of
AIMAG. Its argument had to be of type COMPLEX, which
is our default complex.
Robert Corbett
They can be supplied as actual arguments associated with dummy procedures. This is a largely useless functionality (in my opinion), but those particular specifics need to be there to claim compatibility with F66 and F77. Note that specifics were not provided for any intrinsic added in f90 or later. If, for some reason, you need to pass one of the newer intrinsics to a procedure, you can instead pass a user-written function that does nothing but invoke the intrinsic.
The decision to use REAL as the generic name for the union of FLOAT, SNGL, and REAL was made by the F77 committee, so I have no special insights on that decision, but REAL does seem like a reasonable choice to me. After all, they are all functions to convert their arguments to type [default] REAL The addition of the optional KIND argument to REAL was done by the F8X/F90 committee as part of the recharacterization of DOUBLE PRECISION as a different kind of REAL rather than a totally distinct type. If you have questions/comments about that, I may be able to dredge up the relevant reasoning from my memory.
-Kurt
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 <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/20201006/eb8f11c5/attachment.htm>
More information about the J3
mailing list