(j3.2006) Parent component of extension of abstract type
Fri Nov 13 01:23:18 EST 2015
> On Nov 12, 2015, at 5:54 PM, Van Snyder <Van.Snyder at jpl.nasa.gov> wrote:
> There seems not to be a problem with instantiating objects of abstract
Boy, I must really be out in left field today because some basic terms that I thought
I understood are confusing me in this discussion. The standard doesn?t use the word
?instantiate? anywhere. In general OOP terminology, I would think of ?instantiate?
as synonymous with ?construct,? but that?s problematic too because ?construct? in
the standard is almost always a noun or an adjective and, more to the point, not
something in anyway related to instantiation. Relevant exceptions occur when
?construct? is used in derivative forms such as in ?structure constructor? or
?construction of derived-type values? (4.5.10) so I?ll infer the latter phrase as the
meaning of ?instantiate" in the context of this email thread.
> so long as one does not try to use the object to invoke deferred
> type-bound procedures,
Now this truly makes my brain hurt: it?s very hard to match up your previous
use of ?abstract type? with the above use of ?the object?. I think we all agree
that there can never be an object with a dynamic type that is an abstract type so
I?ll infer that ?the object? here is shorthand for something like ?the actual object
whose declared type is abstract in the relevant scope.? And based on the email
you sent a moment ago, I assume that ?deferred type-bound procedures? here
expands into ?deferred type-bound procedures that have not been overridden."
> or use it as the target of a pointer assignment,
> or the source or mold in an allocation if the <allocate-object> is
> Trying to do that ought to produce a hard error message,
> not a gentle reminder that it's problematic. If one extends an abstract
> type and doesn't add any components, objects of the extension type are
> essentially instantiations of the abstract type, which has a
> nonpolymorphic component (its parent component) of abstract type. One
> is not permitted, however, to declare a (nonpolymorphic) component of
> abstract type. The dangerous situation occurs when a polymorphic object
> has an abstract dynamic type, which we have successfully prohibited with
> a really large hammer. But?.
I think your more recent emails clear up my confusion, but I still need to digest
them more fully. For now, I?ll make a side comment that, after years of giving
talks on OOP in Fortran, I finally settled on a strategy of trying to stick to terminology
that is in the Fortran standard. At least that way I?m being precise and specific.
I?m sure I slip up frequently, but I now try to avoid ?instantiate? or ?instantiation? or
?method,? for example, even though those are very common in OOP. I even tend
to avoid using ?construct? as a verb.
I probably sound like the grammar police in this email, which is something I actively
avoid being in everyday English, but I find it helpful to be more strict in talking about
a programming language.
That?s my $0.02.
More information about the J3