[RFC] polymorphic arrays
Daniel Kraft
d@domob.eu
Thu Aug 5 17:01:00 GMT 2010
Hi Janus,
I can probably neither claim to be an expert with gfortran's OOP system
nor array-descriptors, but add some comments anyways.
Janus Weil wrote:
> Now the question is what to do for polymorphic arrays, i.e. CLASS
> variables with the DIMENSION attribute. Basically I see two
> possibilities:
> 1) Use the class container also for polymorphic arrays, and have the
> "$data" field point to an array descriptor.
> 2) Extend the array descriptor to include some "$vptr" field, which
> would determine the dynamic type of the array, and use this instead of
> a class container.
>
> Would both of these implementations actually work? If yes, which one
> is favorable? Are there any further alternatives? [I'm currently
> slightly tending to prefer option #2, but since I have no experience
> with array descriptors at all, I'd like to hear other opinions.]
To me it seems that #1 is the "natural" approach given what we currently
do. While going with #2 seems to be more light-weight and "better" to
me for arrays, it will both introduce a somewhat distinct implementation
for polymorphic scalars and arrays and will also not work with the
approach of doing everything (or mostly everyting?) at the front-end
level -- at least it seems thus to me.
I do not know what to recommend, but if you go for #2, I would think
about a way to nicely use a "similar" technique also for polymorphic
scalars if possible.
Not sure if this helps for anything, but good luck :)
yours,
Daniel
--
http://www.pro-vegan.info/
--
Done: Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz
To go: Hea-Kni-Mon-Pri
More information about the Fortran
mailing list