UNION and MAP commands

Peter Kämpf Peter.Kaempf@fbmev.de
Sat Aug 28 08:22:00 GMT 2004


Hi,

as a longtime F90 user, I try to get my programs running with gfortran. 
So far, most code compiles well, except for UNION assignments, which 
seem to be not yet implemented. Since they are, strictly speaking, not 
part of the core F90 language, will they ever be implemented?

The semantics are:
TYPE foo
   UNION
      MAP
         [variable declaration 1]
      END MAP
      MAP
         [variable declaration 2]
      END MAP
   END UNION
END TYPE foo

This will assign the same storage location to declaration 1 and 
declaration 2, somewhat like EQUIVALENCE. UNION is very helpful in 
making code much more readable, yet flexible, by adressing single field 
elements with descriptive names. I would miss it a lot!

Regards,
Peter



More information about the Fortran mailing list