From j.l.schonfelder@liverpool.ac.uk  Fri Jul  4 15:28:43 1997
Received: from pcmail.liv.ac.uk (pp@pcmail.liv.ac.uk [138.253.252.13]) by dkuug.dk (8.6.12/8.6.12) with SMTP id PAA15339 for <sc22wg5@dkuug.dk>; Fri, 4 Jul 1997 15:28:42 +0200
Received: from jlspcnt.liv.ac.uk [138.253.102.118] 
	by pcmail.liv.ac.uk with smtp (Exim 1.61 #3)
	id 0wk8Pf-0006Ea-00; Fri, 4 Jul 1997 14:28:39 +0100
From: Lawrie Schonfelder <j.l.schonfelder@liverpool.ac.uk>
Sender: J.L.Schonfelder@liverpool.ac.uk
Reply-To: j.l.schonfelder@liverpool.ac.uk
To: sc22wg5@dkuug.dk
Subject: Re: (SC22WG5.1407) Varying string standard
In-Reply-To: <199707040503.HAA09554@dkuug.dk>
Message-ID: <SIMEON.9707041437.D@jlspcnt.liverpool.ac.uk>
Date: Fri, 4 Jul 1997 14:28:37 +0100 (British Summer Time)
Priority: NORMAL
X-Mailer: Simeon for Win32 Version 4.1.1 Build (17)
X-Authentication: IMSP
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII


On Fri, 4 Jul 97 14:07:47 +0900 Minoru Tanaka <m-tanaka@lp.nm.fujitsu.co.jp> 
wrote:



> My colleague tried compilation of the module using our Fortran 95 compiler 
> alpha version for Win95/NT (currently its name is Fortran 90 compiler yet :-)). 
> At that time, we had the following compilation errors:
> 
> Fortran 90 diagnostic messages: program name(ISO_VARYING_STRING)
>  Module subprogram name(s_to_c)
>   jwd2063i-s  "iso_vst.f90", line 308: The dummy argument of the elemental procedure shall not appear in a 
> specification expression.(name:string)

>  Module subprogram name(s_to_fix_c)
>   jwd2063i-s  "iso_vst.f90", line 320: The dummy argument of the elemental procedure shall not appear in a 
> specification expression.(name:length)
In the latest version these are not elemental, merely pure.

>  Module subprogram name(s_ass_s)
>   jwd2063i-s  "iso_vst.f90", line 339: The dummy argument of the elemental procedure shall not appear in a 
> specification expression.(name:expr)
This is definitely meant to be ELEMENTAL. The code is
ELEMENTAL SUBROUTINE s_ass_s(var,expr) 
  type(VARYING_STRING),INTENT(OUT) :: var 
  type(VARYING_STRING),INTENT(IN)  :: expr 
  !  assign a string value to a string variable overriding default assignement 
  !  reallocates string variable to size of string value and copies characters 
  CHARACTER :: tmpexpr(1:LEN(expr))
  tmpexpr = expr%chars
  IF(ASSOCIATED(var%chars))DEALLOCATE(var%chars)
  ALLOCATE(var%chars(1:SIZE(tmpexpr)))
  var%chars = tmpexpr 
 ENDSUBROUTINE s_ass_s 

The line 
  CHARACTER :: tmpexpr(1:LEN(expr)) 
appears to offend a constraint that I had not noticed until now,
Page 214, lines 3-5, which restricts the use of dummy args in spec-expr to 
appear as args to intrinsic inquiry functions. Thus removing one of the 
important capabilities of PURE functions introduced in F95. 
In this particular case I can work round the problem within the module since 
the internal structure of the type is visible so I can replace the offending 
declaration by.
  CHARACTER :: tmpexpr(1:LEN(expr%chars))
instead of the call to the overload for strings defined elsewhere in the 
module. A user of the module cant do this because the internal structure is 
rightly private. The major advance of F95 in supporting semantic 
extension/data abstraction and moving towards Object orientation is therebye 
seriously damaged yet again by an unnecessary restriction in this area.
Why was this constraint not phrased in terms of specification functions, in 
fact why is this constraint needed at all?
 
>  Module subprogram name(replace_ssc)
>   jwd1727i-s  "iso_vst.f90", line 2345: The name cannot be specified because it is already used as a module 
> function name.(name:replace_sss)
This is a typo and has been fixed in latest version
> 
> 
> ---
> Minoru Tanaka
> Email: m-tanaka@lp.nm.fujitsu.co.jp
> 
> 
> 
Check the URL for latest versions.
http://ns7.liv.ac.uk/jls/
--
Lawrie Schonfelder
Director, Computing Services Dept.
The University of Liverpool, UK, L69 7ZF
Phone: 44(151)794 3716, Fax: 44(151)794 3759




