This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: UNION and MAP commands
- From: Paul Brook <paul at codesourcery dot com>
- To: fortran at gcc dot gnu dot org
- Cc: Peter Kämpf <Peter dot Kaempf at fbmev dot de>
- Date: Sat, 28 Aug 2004 12:42:30 +0100
- Subject: Re: UNION and MAP commands
- Organization: CodeSourcery
- References: <6DCFBD59-F8CB-11D8-982A-000393B90544@fbmev.de>
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