From J.L.Schonfelder@liverpool.ac.uk Fri Jun 24 06:33:45 1994
Received: from mailhub.liverpool.ac.uk (mail.liv.ac.uk) by dkuug.dk with SMTP id AA12206
  (5.65c8/IDA-1.4.4j for <SC22WG5@dkuug.dk>); Fri, 24 Jun 1994 14:34:18 +0200
Received: from liverpool.ac.uk by mailhub.liverpool.ac.uk with SMTP (PP) 
          id <25937-0@mailhub.liverpool.ac.uk>; Fri, 24 Jun 1994 13:33:50 +0100
Date: Fri, 24 Jun 1994 13:33:45 PDT
From: Lawrie Schonfelder <J.L.Schonfelder@liverpool.ac.uk>
Subject: Re: (SC22WG5.576) Duplicate Interface Declaration
To: "Erik W. Kruyt (+31 71 276804)" <KRUYT@rullf2.LeidenUniv.NL>
Cc: SC22/WG5 members <SC22WG5@dkuug.dk>
Message-Id: <ECS9406241345A@liv.ac.uk>
Priority: Normal
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
X-Charset: ASCII
X-Char-Esc: 29

I had thought about your question which is why I used the word identical. 
I mean identical literally, But if implementers could do better than that 
I would be happy to relax the restriction. My point still holds though
The standard rightly requires interface declarations of external 
procedures to match those of the actual procedure with no mechanism at all 
to check this match. For module or internal procedures this checking can 
be done.


On Fri, 24 Jun 1994 09:49:18 +0100 (MET) Erik W. Kruyt (+31 71 276804) 
wrote:

> From: Erik W. Kruyt (+31 71 276804) <KRUYT@rullf2.LeidenUniv.NL>
> Date: Fri, 24 Jun 1994 09:49:18 +0100 (MET)
> Subject: Re: (SC22WG5.576) Duplicate Interface Declaration
> To: J.L.Schonfelder@liverpool.ac.uk
> 
> Dear Lawry,
> 
> Duplicating declarations can be tricky as we have learned from languages 
like
> Modula-2. The problem is: what is identical?
> Should it mean literally, syntactically or semantically? Users give 
preference
> to the last, but that can be complicated or even ambiguous for a 
compiler.
> You require already that dummy arguments must have the same name. But do 
we 
> allow the following to be the same?
> 
> INTERFACE 
>   SUBROUTINE SUB(IARG)
>     INTEGER, DIMENSION(10) :: IARG
>   END SUBROUTINE
> END INTERFACE
> ..
> CONTAINS
>   SUBROUTINE SUB (IARG)
>     INTEGER, PARAMETER :: IS=10
>     INTEGER IARG(IS)
>   END SUBROUTINE
I would like to think a smart compiler could recognise these to be the 
same and accept them, but I hope I have written the proposal so as to not 
require the compiler to do so.
 INTERFACE 
   FUNCTION FUN(IARG)
     INTEGER, DIMENSION(2*IARG) :: FUN
   END FUNCTION
 END INTERFACE
 ..
 CONTAINS
   FUNCTION FUN(IARG)
     INTEGER, DIMENSION(IARG+IARG) :: FUN
   END FUNCTION
I would definitely expect the processor to flag the above. In general
duplication in this area is needed to allow definitions to be done in both 
places where frequently different issues are the design priority (overload 
resolution in one and specific procedure implementation in the other. The 
safe and desirable maintenance requirement is that these two definitions 
then be kept strictly in identical step.


> 
> Erik
--
Dr.J.L.Schonfelder
Director, Computing Services Dept.
The University of Liverpool, UK
e-mail J.L.Schonfelder@liv.ac.uk
phone: +44(51)794-3716
fax:   +44(51)794-3759



