From J.Reid@letterbox.rl.ac.uk  Mon Sep 18 12:43:23 1995
Received: from letterbox.rl.ac.uk (letterbox.rl.ac.uk [130.246.8.100]) by dkuug.dk (8.6.12/8.6.12) with SMTP id MAA15070 for <SC22WG5@dkuug.dk>; Mon, 18 Sep 1995 12:43:17 +0200
Received: from jkr.cc.rl.ac.uk by letterbox.rl.ac.uk with SMTP (PP) 
          id <g.09951-0@letterbox.rl.ac.uk>; Mon, 18 Sep 1995 11:42:13 +0100
Received: by jkr.cc.rl.ac.uk (4.1/SMI-4.1) id AA26113;
          Mon, 18 Sep 95 11:42:49 BST
Date: Mon, 18 Sep 95 11:42:49 BST
From: jkr@letterbox.rl.ac.uk (John Reid)
Message-Id: <9509181042.AA26113@jkr.cc.rl.ac.uk>
To: SC22WG5@dkuug.dk
Subject: Allocatable components
Cc: john@quetzalcoatl.com, purnell@lee.kelburn.cri.nz

> 
> From: purnell@lee.kelburn.cri.nz
> To: john@quetzalcoatl.com
> Cc: purnell@lee.kelburn.cri.nz
> Subject: deficiencies of Fortran 90 
> Date: Fri, 08 Sep 95 15:29:05 +1200
> 
>  In response to your article quoted in "the computer transition systems
>  report" august 95.
> 
> I am using Fortran 90 for a fluid-dynamic application, but find  that
> the current support for user-defined-data-types is very limited. e.g.
> 
> for functions that return an array, the dimensions of the result array
> can be declared using dimension information obtained from array
> arguments. Since the result is allocated on the stack, expressions such
> as
>          A = (B^C)^D
> with a user defined operator ^ can be written without any need to worry
> about releasing memory used in the temporary (B^C), the stack will take
> care of it.
> 
> But there is no corresponding facility for functions that return a
> user-defined-type. Either the user-defined-type has components of fixed
> size, or it has pointer components that are allocated explicitly.  In
> the second case there is a problem deallocating the memory allocated by
> (B^C), since the associated pointer no longer exists after the
> expression is evaluated. One would be forced to use a horrible trick
> such as keeping a list of copies of these pointers, and deallocating
> them at a suitable time.
> 
> Parameterized user-defined-types would help here, if of the same
> quality as provided for the Array data type where one can specify
> dynamic dimension parameters.
> 
> User-defined-types seem to be very second-class in Fortran 90. Since
> they are at the heart of OOPS capability, i dont see that Fortran 90
> has any worthwhile OOPS capability yet. I greatly hope that the
> standards committee will fix these serious faults.
> 
> Don Purnell
> 

This is a strong plea for allowing allocatable components of derived
types. WG5 decided that it wanted this to be added to Fortran 95, but
unfortunately the technical work was not completed in time. However, it
has established a development body to to produce a Technical Report on
handling data type enhancements that include allocatable components.
The target schedule is for a draft to be produced this calendar year.

The intent of such a Technical Report is to allow the syntax and
semantics of a feature to be determined in advance of the next revision
and placed in the public domain in order that implementors will feel
able to provide these features as extensions to their compilers.  In
order to give the implementors the confidence to develop such
extensions, WG5 also agreed that when these features were added to the
next revision of the standard it would not alter the syntax or
semantics of them unless experience in the implementation or use of the
features had identified errors which needed to be corrected.

John Reid.
