(j3.2006) Interface and PURE
Malcolm Cohen
malcolm
Tue Oct 31 03:03:46 EDT 2017
Hi Bill,
You seem to be over-thinking this. There are only two possible purity states for a procedure:
1. Pure;
2. Not pure.
That?s it. How they get specified is merely a matter of syntax. The requirement is on the states (whether it is pure) not on how it is specified. None of your examples is ambiguous in any way.
Cheers,
--
..............Malcolm Cohen, NAG Oxford/Tokyo.
From: J3 [mailto:j3-bounces at mailman.j3-fortran.org] On Behalf Of Bill Long
Sent: Tuesday, October 31, 2017 6:44 AM
To: fortran standards email list for J3 <j3 at mailman.j3-fortran.org>
Subject: (j3.2006) Interface and PURE
In 15.4.3.2 Interface block (page 305), para 7, we say:
"If an explicit specific interface for an external procedure is specified by an interface body or a procedure declaration statement (15.4.3.6), the characteristics shall be consistent with those specified in the procedure definition, except that the interface may specify a procedure that is not pure even if the procedure is defined to be pure.?
With prefix choices of IMPURE, PURE, and neither, there are 9 possibilities:
OK combinations:
???????????
Procedure definition: PURE, Interface: PURE
Procedure definition: PURE, Interface: IMPURE
Procedure definition: PURE, Interface: (none specified)
Procedure definition: IMPURE, Interface: IMPURE
Procedure definition: (none specified), Interface (none specified)
BAD combinations:
????????????
Procedure definition: IMPURE, Interface: PURE
Procedure definition: (none specified), Interface: PURE
Questionable combinations:
??????????????????
Procedure definition: IMPURE, Interface : (none specified)
Procedure definition: (none specified), Interface IMPURE
The OK group are clearly allowed. The BAD group are clearly disallowed (and dangerous). For ?Questionable? group, are IMPURE and ?none specified? considered ?consistent? for the purposes of this paragraph? (Except for the case of an ELEMENTAL procedure where ?none specified? is equivalent to PURE.) Or are those two options also considered errors?
Cheers,
Bill
Bill Long longb at cray.com <mailto:longb at cray.com>
Principal Engineer, Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9143
Cray Inc./ 2131 Lindau Lane/ Suite 1000/ Bloomington, MN 55425
_______________________________________________
J3 mailing list
J3 at mailman.j3-fortran.org <mailto:J3 at mailman.j3-fortran.org>
http://mailman.j3-fortran.org/mailman/listinfo/j3
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.
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: <http://mailman.j3-fortran.org/pipermail/j3/attachments/20171031/92ac70b7/attachment.html>
More information about the J3
mailing list