Re: a history question

From: Arjen Markus (arjen.markus_at_wldelft.nl)
Date: 09/29/04


Date: Wed, 29 Sep 2004 13:51:34 +0200

Richard Edgar wrote:
>
> Arjen Markus wrote:
>
> >>I'm not certain of the answer to either question - although I very much
> >>doubt that the second one is possible, given that as things stand I have
> >>to reimplement a linked list for every new datatype.
> >
> > Ah, that is not quite true: I have built a small library for dealing
> > with trees. I can store any data type in the nodes of these trees. The trick
> > is to use the not-so-well-known intrinsic function transfer().
>
> What does that do to the typing information?
>
> Richard

Well, in my library I keep track of the proper types myself (it is
done as a string indicating the data type), but the thing is that the
compiler still has access to the interfaces of all routines (they are
contained in a module) and I can still store different types of data
with one version of my source code.

There is no need for separate code that works on trees holding integers
or derived types or whatever. Via Fortran's INTERFACE facilities you
can hide all nasty details and make the thing type-safe.

Regards,

Arjen



Relevant Pages