Fwd: DEC Extension Patches: Structure, Union, and Map

Jim MacArthur jim.macarthur@codethink.co.uk
Thu Mar 3 14:31:00 GMT 2016


On 01/03/16 21:07, Fritz Reese wrote:
> Greetings,
>
> Please see the previous thread on this discussion for my original proposal:
> https://gcc.gnu.org/ml/fortran/2014-09/msg00255.html
> STRUCTURE is implemented as a very simple version of TYPE, with a new
> flavor FL_STRUCT. The key differences are outlined in the gfortran
> info page. Instances of STRUCTUREs still have basic type BT_DERIVED,
> and are treated mostly the same as instances of TYPEs. Just like TYPE,
> a STRUCTURE definition is stored in the symbol table beginning with an
> upper-case letter to disambiguate it from other symbols, which are
> converted to lower-case during parsing. Unlike TYPE however, STRUCTURE
> does not imply a FL_PROCEDURE symbol with the same name in lower-case
> for a constructor. The translation to generic is handled by the same
> function as for TYPE (gfc_get_derived_type), though STRUCTURE is
> always treated as if the SEQUENCE attribute were specified.

I'm not qualified to review these, but I've tested them and they work 
perfectly for everything I've thrown at them so far. The STRUCTURE 
support is very welcome; I've had my own version of this for some time 
but it didn't handle cases such as fields called 'eq', etc, as well as 
this. Thank you very much for this work.



More information about the Fortran mailing list