(j3.2006) derived types with type parameters are different

Lawrie Schonfelder j.l.schonfelder
Wed Jul 30 05:45:50 EDT 2008

>From memory, getting increasingly fallible these days (:-(, SEQUENCE for parameterised types was
justified on grounds that you might need to force a storage order to facilitate some optimisation
and some interlanguage programming.

The first time the question of equivalence of types was considered the proposal was that two
separate type definitions were equivalent if and only if they were lexically identical. This was
considered too restrictive. The first relaxation was to allow parameter names to be different but
maintaining lexical identity for the parameter expressions. This too was rejected and the current
expression equivalence rule invented. It was claimed that this form of equivalence was already a
feature of determining the characteristics of a procedure interface, so it was no big deal.

My view has always been that even if you except the need for SEQUENCE types, multiply declared
SEQUENCE types are unnecessary. The type can always be declared in a module and used where ever it
is needed. If you believe that multiple declarations are essential, then I would go with requiring
lexical equivalence except for different dummy parameter names. This is no big deal for the user
(likely to be very few IMO) and it simplifies implementation; the implementer can and should
diagnose a difference between N+N and 2*N. Users playing silly games like this get no sympathy from

Lawrie Schonfelder
Wirral, UK

> -----Original Message-----
> From: j3-bounces at j3-fortran.org [mailto:j3-bounces at j3-fortran.org]On
> Behalf Of Andy Vaught
> Sent: 29 July 2008 23:43
> To: fortran standards email list for J3
> Subject: Re: (j3.2006) derived types with type parameters are different
> On Tue, 29 Jul 2008, Aleksandar Donev wrote:
> > On Tuesday 29 July 2008 13:46, Michael Ingrassia wrote:
> > > If it causes significant loss of functionality, what exactly is the
> > > functionality that we lose?
> > I (and probably Lawrie andothers) agree, but there is the issue of backward
> > compatibility and simply not making "language design" changes
> > retroactively---only fixes of techical messups.
>   You're worried about backwards compatibility on a feature that few
> compilers have implemented.  Surely, very few people are today depending
> on parametrized derived types and even fewer are further depending on the
> compiler to figure out that n+n is the same as 2*n in a sequence type.
>      Andy
> _______________________________________________
> J3 mailing list
> J3 at j3-fortran.org
> http://j3-fortran.org/mailman/listinfo/j3

More information about the J3 mailing list