UNION and MAP commands
Paul Brook
paul@codesourcery.com
Sat Aug 28 11:42:00 GMT 2004
On Saturday 28 August 2004 09:22, Peter Kämpf wrote:
> 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!
Like the rest of gcc, gfortran is a volunteer driven project. Basically this
means things get done when a someone cares enough to write the
implementation, or pays someone else to do it for them.
I don't think anyone would object to UNION types, they look like a fairly
clean and useful extension. However I'm not aware of anyone planning to
implement them in the near future.
Paul
More information about the Fortran
mailing list