Adding UNION/MAP -- Feedback and tips pls!

W Spector w6ws@earthlink.net
Fri Mar 8 00:36:00 GMT 2013


"N.M. Maclaren" <nmm1 at cam dot ac dot uk> wrote:
> Aside:  There IS actually a very simple way to port DEC UNION code;
> simply change them to structures (i.e. derived types).  That wastes
> memory but, compared to the machines on which they were used, modern
> ones have near-infinite memory.  I can't think of a circumstance under
> which working DEC UNION code would fail with that trick.

I can.  Many years ago, I worked on a project where UNION/MAP would have 
been very useful.  It was needed because the memory was mapped to 
hardware which needed data written to certain fixed locations 
differently depending on context.  So I can sympathize with adding the 
feature (but only under option - not by default.)

I worked around it, but it was somewhat ugly.  Today I would try to use 
type extension and/or class(*) to overlay the memory.

Walter



More information about the Fortran mailing list