[F03] OOP & polymorphism
Janus Weil
janus@gcc.gnu.org
Tue Sep 15 12:25:00 GMT 2009
Paul,
> Before we go too far down the road and find that we have written so
> much code that we cannot conveniently reverse it, I have the following
> questions:
>
> (i) We have associated the type CLASS to the typespec, which is fine,
> but not in the canonical fashion; ie. should we have a BT_CLASS,
> rather than the is_class field in the typespec? I know that it will
> mean a bit of upfront work but it might make maintenance a bit easier
> in the future.
I think this makes sense. When I introduced the 'is_class' field with
my CLASS parsing patch, I also considered the other option (BT_CLASS),
but decided to use is_class because it is less invasive.
Now that we're really implementing CLASS, I think it is indeed cleaner
to make the distinction via BT_TYPE/BT_CLASS, because the two really
are very different (since CLASS uses an extra container) and there is
not much common ground left. I admit, I could have thought of that
earlier, but I guess at the time it was more important to me to just
make a start with implementing CLASS ...
Your other two bullets are more general, and should probably be
attacked independent of the OOP patch, if I understand you right.
> (ii) We are generating a lot of code in the front end, associated with
> F03 and F08 features. Maybe we should shift this code to identified
> blocks within the existing gfortran files? Again, I had maintenance
> in mind.
You mean, like putting that code into dedicated routines, or rather
shifting the existing routines inside the files?
> (iii) Similarly, and more generally, our use of a universal prefix
> gfc_ for globally visible functions has become somewhat
> self-defeating; especially for Doxygen documentation. Whilst I don't
> especially like to think of the work involved, maybe we should include
> the source file name somewhere?
What exactly do you mean by 'somewhere'? Putting the source file name
into the function name? I think for many functions this is already the
case (e.g. most of the functions in resolve.c do already have a
'resolve' in their name). About the gfc_ prefix one may argue ...
> PS I was think of updating the Doxygen documentation; does anybody use it?
Actually I was not really aware that it exists ...
Cheers,
Janus
More information about the Fortran
mailing list