Re: Unions in Fortran
- From: Dan Nagle <dannagle@xxxxxxxxxxx>
- Date: Sat, 25 Mar 2006 01:48:38 GMT
James Giles wrote:
<snip>
I wouldn't support unions unless they were tagged (discriminated)
and the tags were enforced. That is, all languages with unions
say something to the effect that after you assign the entity one way
it's illegal to access the other, but most provide no protection
against such violations. It's fairly easy for such a protection
feature to be implemented, it just requires more information
be stored with the union to hold the tag and some extra syntax
to make testing and setting the tags clear.
I imagine such tags would require a strong enumeration type.
<snip>
--
Cheers!
Dan Nagle
Purple Sage Computing Solutions, Inc.
.
- Follow-Ups:
- Re: Unions in Fortran
- From: James Giles
- Re: Unions in Fortran
- References:
- Unions in Fortran
- From: s8ngsu3
- Re: Unions in Fortran
- From: Joe Krahn
- Re: Unions in Fortran
- From: James Giles
- Unions in Fortran
- Prev by Date: Re: Unions in Fortran
- Next by Date: Re: Unions in Fortran
- Previous by thread: Re: Unions in Fortran
- Next by thread: Re: Unions in Fortran
- Index(es):
Relevant Pages
|