This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, fortran] Preliminary patch for derived type extension


Paul Richard Thomas wrote:
Barring these problems, the attached patch is already usable and gives
an indication of what the final patch will look like.  It is also
ready for basic tests of inheritance of derived type parameters or
type bound procedures, if anybody is so minded to give it a try.

Hi Paul,


I read through your patch and while I can't comment on details (you probably know them far better than I do), I believe the logic is quite straight and well done like it is.

It's maybe not really my taste to make the super-type just the first component of the derived type (if attr.extended is on). I'd probably include another pointer in the derived type structure itself (besides "components"), say, "super"; but that's probably a symptom of my usual hang for overpowered designing... Another idea would be to define a macro/function to access the super-type. But both of those are probably not really necessary, just go ahead :)

!   if (extended && !sym->components)
!     {
!       gfc_component *p;
!       gfc_symtree *st;

I've not looked thoroughly at the code, but why is the this check for !sym->components? When could there already be components? Why don't we need to add the super-type in that case? Quickly and without knowing the details, I'd say an assertion would be better?

I'll think about type-bound procedures a bit and if I've additional comments regarding the future implementation of those, I'll post them later.

Cheers,
Daniel

--
Done:     Arc-Bar-Sam-Val-Wiz, Dwa-Elf-Gno-Hum-Orc, Law-Neu-Cha, Fem-Mal
Underway: Cav-Dwa-Law-Fem
To go:    Cav-Hea-Kni-Mon-Pri-Ran-Rog-Tou


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]