From rz48@rz.uni-karlsruhe.de  Sat Dec 21 19:52:22 1996
Received: from nz11.rz.uni-karlsruhe.de (nz11.rz.uni-karlsruhe.de [129.13.64.7]) by dkuug.dk (8.6.12/8.6.12) with ESMTP id TAA03228 for <sc22wg5@dkuug.dk>; Sat, 21 Dec 1996 19:52:20 +0100
Message-Id: <199612211852.TAA03228@dkuug.dk>
Received: from ry73.rz.uni-karlsruhe.de by nz11.rz.uni-karlsruhe.de with SMTP (PP); Sat, 21 Dec 1996 19:52:08 +0100
Received: by ry73.rz.uni-karlsruhe.de
	(1.38.193.4/16.2) id AA14818; Sat, 21 Dec 1996 19:52:07 +0100
Subject: PURE/ELEMENTAL for C procedures?
To: sc22wg5-interop@ncsa.uiuc.edu, sc22wg5@dkuug.dk
Date: Sat, 21 Dec 1996 19:52:06 +0100 (CET)
From: hennecke@rz.uni-karlsruhe.de (Michael Hennecke)
Reply-To: hennecke@rz.uni-karlsruhe.de (Michael Hennecke)
X-Mailer: ELM [version 2.4 PL23]
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit
Content-Length: 1659      

F95 restricts PURE and ELEMENTAL to subprograms, and places a number of 
restrictions on the (Fortran) definition of such subprograms (e.g. no 
print-stmt or other external I/O shall appear). This allows compile-time
checking of some of the factors that may prevent the PUREness of such
subprograms.

As it stands, a procedure defined by means of C which has an explicit 
interface (with the BIND(C) prefix) is not allowed to have the PURE or
ELEMENTAL attribute, because it is not a subprogram. It is also not
possible to ``hide'' this procedure defined by means of C in a PURE 
(Fortran) wrapper subprogram because all references to procedures within
such a PURE subprogram must also be pure.

  QUESTION:
  Should this restriction be relaxed, simply believing the programmer who 
  specifies PURE in an explicit interface for a procedure even if this case
  compile-time checks are, in general, impossible?

Needless to say that writing down the words to say that the results are 
undefined if the procedure actually is not PURE will be a difficult task...

Best regards,
Michael

 ======================================================================
  Michael Hennecke      http://www.uni-karlsruhe.de/~Michael.Hennecke/ 
 ----------------------------------------------------------------------
  University of Karlsruhe         RFC822: hennecke@rz.uni-karlsruhe.de 
  Computing Center (G20.21 R210)               No longer on BITNET :-(
  Zirkel 2  *  P.O. Box 69 80                 Phone: +49 721  608-4862 
  D-76128  Karlsruhe                               Fax: +49 721  32550 
 ======================================================================
