J3/03-141 To: J3 From: David Muxworthy Subject: TYPEALIAS description Date: 12 March 2003 UK comment TC8 was a proposal to delete the TYPEALIAS facility on the grounds that it added little benefit to the language and indeed its use was potentially confusing as it appeared to offer a quick way of changing variable types without at the same time changing corresponding constants, operators, format codes, or any other related entities. The Canadian Fortran Working Group had suggested this facility which appeared as item 11 in the 1995 WG5 repository of requirements (N1144) for Fortran 2000, but which was not selected for the language, possibly on the grounds that it appears to promise more than it actually delivers. Nevertheless, should TYPEALIAS be retained in the language, it is suggested that the basic description be simplified as shown below and that the example of use given by the Canadian group should appear as an additional example. Edits suggested are: 61:2-3. Replace "A type alias ... new type." by "A <> is a pseudonym for an existing type and a fixed set of type parameter values. It may be used to declare entities; it is not a separate type." 61:6. Delete (italicised) "declaration-". {since differs from only in two ways: (1) it allows CLASS ... but that's not allowed in a type alias statement, so is irrelevant. (2) it requires the type parameter values to be specification expressions, but since in a type alias stmt they are required to be initialization expressions that too is irrelevant. So we should use the simpler BNF rule, viz .} 61:9. Delete C479. 61:10. Delete (italicised) "declaration-". 61:13. Delete (italicised) "declaration-". 61:13+. Add new Note 4.59a: "If variables a, b are declared as: TYPE(float) :: a, b then the precision of these and corresponding variables, but not literal constants or other related entities in a program, may be changed by choice of one of, for example, TYPEALIAS :: float => REAL(KIND(1.0)) TYPEALIAS :: float => REAL(KIND(1.0D0)) TYPEALIAS :: float => TYPE(verylong) in a single location in an appropriate scope."