Adding UNION/MAP -- Feedback and tips pls!
N.M. Maclaren
nmm1@cam.ac.uk
Thu Mar 7 14:13:00 GMT 2013
On Mar 7 2013, Russell Brennan 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.
>
>Of course if you have the ability to change *all* the code in use then
>there are several ways to replace union. On the other hand, if you
>need to maintain a consistent API (always a good thing) or simply
>cannot change some pieces of code, then you are out of luck. As is
>often the case, what is practical is not always what is best.
Well, yes, but this is starting to sound as if you want more than just
a feature to enable old code to run, but want to extend the gfortran
language for new code and in the long term.
It is very important that such an extension doesn't break existing,
more widely-used facilities, or prevent important new extensions. For
example, unchecked unions are notoriously antagonistic to reliable
bounds and pointer checking or garbage collection. As far as I know,
there are no plans to add either, but that sort of problem needs to be
borne in mind.
Regards,
Nick Maclaren.
More information about the Fortran
mailing list