[log in to unmask] wrote:
...
> CLASS(*) objects aren't generic, they're unlimited polymorphic. There's
> a difference. [...]
Yes, I know. It's still the appropriate place to being thinking about
generics. What missing is constraints on the unlimited nature of the
declaration.
> [...] The type of a CLASS(*) entity is variable at run time.
Not necessarily.
> The precise procedure to be invoked is decided at run time. [...]
Not necessarily.
> [...] The existing
> Fortran generic procedure mechanism resolves to a specific procedure at
> compile time. [...]
So would a constrained form of CLASS(*).
> [...[] Like it or not, run-time resolution can introduce a
> substantial performance penalty. [...]
Sure would. But it's not on the table. I't's an irrelevant alternative.
> I don't see how a macro facility prevents any of the problems Giles
> laments for the Ada generic package facility. [...]
I don't either. That's why I don't recommend macros - *OR* your
proposal, which does nothing more than macros could do. However,
if we are to be stuck with something anything like your proposal, a
general macro feature would handle it all (with the same drawbacks)
and be applcable to other things as well.
--
J. Giles
"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies." -- C. A. R. Hoare
|