From jkr@jkr.cc.rl.ac.uk  Fri Feb 23 14:42:07 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 OAA91789
	for <SC22WG5@dkuug.dk>; Fri, 23 Feb 2001 14:40:44 +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 NAA20751
	for <SC22WG5@dkuug.dk>; Fri, 23 Feb 2001 13:40:20 GMT
Received: (from jkr@localhost)
	by jkr.cc.rl.ac.uk (8.8.8+Sun/8.8.8) id NAA22905
	for SC22WG5@dkuug.dk; Fri, 23 Feb 2001 13:42:08 GMT
Date: Fri, 23 Feb 2001 13:42:08 GMT
From: John Reid <jkr@rl.ac.uk>
Message-Id: <200102231342.NAA22905@jkr.cc.rl.ac.uk>
To: SC22WG5@dkuug.dk
Subject: Iterpretation 21 (Name on END INTERFACE): New draft response
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"


Dear WG5,
         I would like to thank all of those who commented on my draft.
I am now convinced that an edit is needed and that my simple edit
does not resolve the ambiguity. I have based new wording on what we
already say for other constructs.

Kurt said: 'I suspect that some lexical analyzers may return the same
token for ".NE." and "/=", so lexically identical may not properly
capture what you want to say.'.  I then tried the three f95 compilers
to which I have access on my SUN and found that they all allow this.
So I am now inclined to think that example 1 should be allowed. 

Here follow two alternatives, both with (rather verbose) edits.

I would appreciate any further comments you may have before I send it
to J3, preferably to me in private.

Cheers,

John. 

..................................................

NUMBER: 000021
TITLE: Restrictions on <generic-spec> on END INTERFACE
KEYWORDS: INTERFACE block, END INTERFACE, generic procedures
DEFECT TYPE: Erratum
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 and
the interpretation of the operators .LT., .LE.,.GT., .GE., .EQ., and
.NE. as always being identical to <, <=, >, >=, ==, and /=.

Example 1 conforms to the standard, but example 2 does not. 

Edits are provided to make this clear.

EDITS: 
On page 194, subclause 12.3.2.1, in the fourth constraint following
R1207 [194:19-20] delete 'and, if included, ... <interface-stmt>' and
add:
   If the <end-interface-stmt> includes <generic-name>, the
   interface-stmt> shall specify the same <generic-name>.  If the
   <end-interface-stmt> includes ASSIGNMENT(=), the <interface-stmt>
   shall specify ASSIGNMENT(=).  If the <end-interface-stmt> includes
   OPERATOR(<defined-operator>), the <interface-stmt> shall specify the
   same <defined-operator>.  If one <defined-operator> is .LT., .LE.,
   .GT., .GE., .EQ., or .NE., the other is permitted to be the 
   corresponding operator <, <=, >, >=, ==, or /=.

.......................................................................

Alternative response

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 are provided to make this clear.

EDITS: 
On page 194, subclause 12.3.2.1, in the fourth constraint 
following R1207 [194:19-20] delete 'and, if included, ... <interface-stmt>'
and add:
   If the <end-interface-stmt> includes <generic-name>, the
   interface-stmt> shall specify the same <generic-name>.  If the
   <end-interface-stmt> includes ASSIGNMENT(=), the <interface-stmt>
   shall specify ASSIGNMENT(=).  If the <end-interface-stmt> includes
   OPERATOR(<defined-operator>), the <interface-stmt> shall specify the
   same <defined-operator>.  If one <defined-operator> is .LT., .LE.,
   .GT., .GE., .EQ., or .NE., the other shall not be <, <=, >, >=, ==,
   or /=.
....................................................................... 

SUBMITTED BY: Henry Zongaro

HISTORY: 98-150   m145 Submitted
