[RFC] polymorphic arrays
Paul Richard Thomas
paul.richard.thomas@gmail.com
Sun Aug 22 15:19:00 GMT 2010
Dear Mikael,
I just posted a message saying that I could not find this thread - I
did not go back far enough :-)
> Be realistic, vote (1). [And don't forget to donate ;-)]
>
For what it is worth, this is my opinion too. In fact, like you, I
believe that the $data field should be the descriptor. The reasons
are pretty much as you said:
(i) Code reuse - ie CLASS(mytype), allocatable, dimension(:) :: z is
then directly implementable as TYPE :: <mangled name>; type(mytype),
allocatable, dimension(:) :: $data; type(<mangled name vtab type>) ::
$vptr; end type ; TYPE(<mangled name>) :: z
(ii) This effectively implements (ii) since the $vptr field is tagged
on to the end of the descriptor.
(iii) This maintains the goal of having OOP largely implemented in the
fortran frontend.
Cheers
Paul
More information about the Fortran
mailing list