ISO/IEC JTC1/SC22/WG5 N1355 Page 1 of 2 To: WG5 From: Data Subgroup Author: Lawrie Schonfelder Subject: Simplification of requirement Date:17-JUN-1999 WG5, during its consideration of the current requirements and work-plan for the production of Fortran2000, considered that a significant saving could be achieved by the following changes. ¥ The current description of function and language definition included in the draft document for data-object initialisation (constructors) should be removed. ¥ The current functionality and description for object finalisation (destruction) should be retained, perhaps with some modification and correction. ¥ To add at least some minimal compensatory functionality for the lost capability, the following relaxation should be made. Users should be permitted to override the intrinsic data- type structure constructor by the creation of procedures with a generic name that is the same as the type-name. The same rules should be applied, mutatis mutandis, as already exist for overriding intrinsic definitions for the semantics of intrinsic assignment and intrinsic functions by user written generic procedures. It is accepted that this loses some potentially useful functionality but it is believed that such a change would make a substantial reduction in J3Õs workload, while preserving much of the critical capability of the constructor/destructor requirement. Although this proposal will not in general allow the creation of user defined derived type objects with the PARAMETER attribute, nor will it make initialisation more generally supportable. It will, however, allow appropriately named user-defined type-conversion procedures to be used to create values of derived types. For example, given a type definition for variable precision arithmetic based on a type, TYPE NUMBER INTEGER::exp INTEGER,POINTER::sig(:) END TYPE NUMBER The user could define additional generic procedures called NUMBER. One specific version could take a single integer argument and another could take a character string argument; both designed to return a value of the NUMBER datatype. This will allow the following set of statements to be valid. type(NUMBER)::ten,c ten=NUMBER(10) c=NUMBER("2.99792458E+8") With a data type such as this the user has no simple way of using the intrinsic value constructors to create the structure values. Usable values can only be created by procedures written by the user to provide a more appropriate type conversion. In general, the logical name for such conversion procedures is the typename. In this example the name NUMBER is the appropriate. This minor change provides a valuable regularisation and aid to program readability and does not preclude the later addition of more extensive constructor functionality.