From owner-sc22wg5@dkuug.dk  Tue Jun 24 19:10:09 2003
Received: (from majordom@localhost)
	by dkuug.dk (8.12.8p1/8.9.2) id h5OHA9JR053865
	for sc22wg5-domo; Tue, 24 Jun 2003 19:10:09 +0200 (CEST)
	(envelope-from owner-sc22wg5@dkuug.dk)
X-Authentication-Warning: ptah.dkuug.dk: majordom set sender to owner-sc22wg5@dkuug.dk using -f
Received: from hermes.jf.intel.com (fmr05.intel.com [134.134.136.6])
	by dkuug.dk (8.12.8p1/8.9.2) with ESMTP id h5OH9xEc053857
	for <sc22wg5@dkuug.dk>; Tue, 24 Jun 2003 19:10:04 +0200 (CEST)
	(envelope-from stan.whitlock@intel.com)
Received: from petasus.jf.intel.com (petasus.jf.intel.com [10.7.209.6])
	by hermes.jf.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id h5OH7nZ08349
	for <sc22wg5@dkuug.dk>; Tue, 24 Jun 2003 17:07:49 GMT
Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206])
	by petasus.jf.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h5OH5FT17065
	for <sc22wg5@dkuug.dk>; Tue, 24 Jun 2003 17:05:15 GMT
Received: from orsmsx26.jf.intel.com ([192.168.65.26])
 by orsmsxvs040.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003062410204621172
 ; Tue, 24 Jun 2003 10:20:47 -0700
Received: by orsmsx26.jf.intel.com with Internet Mail Service (5.5.2653.19)
	id <NH4TL39L>; Tue, 24 Jun 2003 10:09:51 -0700
Message-ID: <29AD895CE780D511A8870002A50A666D06622050@hdsmsx106.hd.intel.com>
From: "Whitlock, Stan" <stan.whitlock@intel.com>
To: "'Van.Snyder@jpl.nasa.gov'" <Van.Snyder@jpl.nasa.gov>, sc22wg5@dkuug.dk
Cc: "Whitlock, Stan" <stan.whitlock@intel.com>
Subject: RE: (SC22WG5.2804) Modules TR syntax 
Date: Tue, 24 Jun 2003 10:11:30 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
	charset="ISO-8859-1"
Sender: owner-sc22wg5@dkuug.dk
Precedence: bulk

Van,

Let me see if I understand where you've ended up:

 . Below is your rewrite of Aleks' example
 . the submodule "SUBMODULE(My_Module) My_Submodule" could be
   contained in the "MODULE My_Module ... END MODULE" or it can
   be as shown, ie, outside the "MODULE My_Module ... END MODULE"
 . SEPARATE can go on the front of a SUBROUTINE or a FUNCTION in
   an INTERFACE block {generic {as shown} or not}
 . your example shows:
   - a SEPARATE Function_1 that is not in the MODULE My_Module
   - a SEPARATE Function_2 that is contained in the MODULE My_Module
   - an F95 module procedure Function_3
   - an external Function_4
 . host association works in the INTERFACE for SEPARATE routines so
   the INTERFACE blocks for Function_1 and Function_2 don't need an
   IMPORT to get stuff from their host
 . Function_4 is not a submodule procedure so it has to IMPORT stuff
   explicitly from its host
 . the contained procedure Function_2 already has host association;
   the SEPARATE in the FUNCTION statement says to check this explicit
   interface against some SEPARATE interface block that has already
   been seen
 . "SUBMODULE(My_Module) My_Submodule" says that My_Submodule contains
   separate procedures mentioned in interfaces in My_Module {assuming
   full redeclaration}
  
   If there isn't "full redeclaration", then we only need "SEPARATE
   INTEGER FUNCTION Function_1" and all other info comes from the
   interface block in My_Module

Have I understood what you're suggesting?

Did I overlook any magic that you wanted me to see?

Thanks			/Stan

-----------------------------------------------------------------

Here's an equivalent to Aleksandar's module, in the syntax I will
propose in N1537:

 MODULE My_Module

   INTERFACE My_Generic
     SEPARATE INTEGER FUNCTION Function_1(x)
       INTEGER :: x
     END FUNCTION
     SEPARATE REAL FUNCTION Function_2(x)
       REAL :: x
     END FUNCTION
     MODULE PROCEDURE :: Function_3
     CHARACTER FUNCTION Function_4(x) ! External
       IMPORT ! OK here
       CHARACTER :: x
     END FUNCTION
   END INTERFACE

 CONTAINS

   SEPARATE FUNCTION Function_2
     Function_2=x*x
   END FUNCTION Function_2

 END MODULE

 CHARACTER FUNCTION Function_4(x)
   CHARACTER :: x
   Function_4=x
 END FUNCTION

 SUBMODULE(My_Module) My_Submodule

 CONTAINS

 SEPARATE INTEGER FUNCTION Function_1(x) ! Full-redeclaration
 ! Or no redeclaration as above
   INTEGER :: x
   Function_1=x*x
 END FUNCTION

 END SUBMODULE
