From jkr@jkr.cc.rl.ac.uk  Thu Feb 22 15:23:00 2001
Received: from nameserv.rl.ac.uk (nameserv.rl.ac.uk [130.246.135.129])
	by dkuug.dk (8.9.2/8.9.2) with ESMTP id PAA84647
	for <SC22WG5@dkuug.dk>; Thu, 22 Feb 2001 15:22:59 +0100 (CET)
	(envelope-from jkr@jkr.cc.rl.ac.uk)
Received: from jkr.cc.rl.ac.uk (jkr.cc.rl.ac.uk [130.246.8.20])
	by nameserv.rl.ac.uk (8.8.8/8.8.8) with ESMTP id OAA02280
	for <SC22WG5@dkuug.dk>; Thu, 22 Feb 2001 14:22:59 GMT
Received: (from jkr@localhost)
	by jkr.cc.rl.ac.uk (8.8.8+Sun/8.8.8) id OAA22435
	for SC22WG5@dkuug.dk; Thu, 22 Feb 2001 14:24:48 GMT
Date: Thu, 22 Feb 2001 14:24:48 GMT
From: John Reid <jkr@rl.ac.uk>
Message-Id: <200102221424.OAA22435@jkr.cc.rl.ac.uk>
To: SC22WG5@dkuug.dk
Subject: Re: Iterpretation 21 (Name on END INTERFACE): Draft response
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"

Dear WG5,
         Here is my next draft interpretation response. This was
discussed a bit at Oulu without reaching a resolution. I think the
sticking point was whether /= and .NE. are 'identical'. My view
is that allowing users this generality is neither useful nor intended.
Also, it is hard to see how the text could be written to allow this
without bizarre things such as Example 2.   

I would appreciate comments before I send it to J3, preferably to me in
private. If you agree with my draft answer, do we need to edit the
standard? If so, would it be enough to change 'identical' to 'lexically
identical'?

Cheers,

John. 



NUMBER: 000021
TITLE: Restrictions on <generic-spec> on END INTERFACE
KEYWORDS: INTERFACE block, END INTERFACE, generic procedures
DEFECT TYPE: Interpretation
STATUS: J3 consideration in progress

QUESTION: According to section 12.3.2.1 [194:18-20]

    The <generic-spec> may be included in the <end-interface-stmt>
    only if it was provided in the <interface-stmt> and, if
    included, shall be identical to the <generic-spec> in the
    <interface-stmt>.

It is not clear what the words "shall be identical" were intended to mean.
In particular, were they intended to merely convey the idea that the two
<generic-spec>s shall specify the same entity, even though such an entity
might be represented in more than one way, or were they intended to convey
something more restrictive?  Are either of the following examples standard
conforming programs?

Example 1:

      PROGRAM P
        INTERFACE OPERATOR(.NE.)
          LOGICAL FUNCTION F(I, C)
            INTEGER, INTENT(IN) :: I
            CHARACTER(*), INTENT(IN) :: C
          END FUNCTION F
        END INTERFACE OPERATOR(/=)
      END PROGRAM P

Example 2:

      MODULE MOD
        INTERFACE GEN
          SUBROUTINE SUB1(I)
            INTEGER :: I
          END SUBROUTINE SUB1
        END INTERFACE
      END MODULE MOD

      PROGRAM P
        USE MOD, G1=>GEN, G2=>GEN
        INTERFACE G1
          SUBROUTINE SUB2(L)
            LOGICAL :: L
          END SUBROUTINE SUB2
        END INTERFACE G2
      END PROGRAM P

ANSWER: 

The intention is that the <generic-spec> in the END INTERFACE statement
should be obviously the same as that in the INTERFACE statement, both
to the human reader and to the compiler.  The words "shall be
identical" signify that they must be lexically identical, that is,
identical apart from layout changes permitted by the source form.
Neither of the example programs is standard conforming.

EDITS:   None

SUBMITTED BY: Henry Zongaro

HISTORY: 98-150   m145 Submitted
