(j3.2006) Abstract type question
Bill Long
longb
Fri Mar 28 20:09:10 EDT 2008
With reference to the current CD (though similar issues are in f03),
[49:C406] says that you cannot have a declaration of
TYPE(<abstract-type>). This is what I expect, and seems to be a
fundamental distinction of abstractness.
However, you can have a polymorphic entity declared with an abstract
type, as in CLASS(T) where T is an abstract type. In fact, [124:C627]
specifically anticipates that you can have an <allocate-object> of
abstract type.
Questions:
1) The first sentence of para 5 of 4.3.1.3 CLASS (page 50) says "A
polymorphic allocatable object may be allocated to be of any type with
which it is type compatible." Does this include the base abstract type
used in the declaration? If so, it would seem to contradict the idea of
not having objects whose dynamic type is abstract. And the sentence in
para 4, "A polymorphic entity that is not a unlimited polymorphic entity
is type compatible with entities of the same declared type or any of its
extensions." seems to suggest you can have type compatibility with your
own declared abstract type.
2) In the list of constraints following the syntax for the ALLOCATE
statement, I do not see a constraint that says "If <type-spec> appears,
it shall not specify an abstract type". Should that be the case? Or is
this covered somewhere else?
I think I know what the answer is supposed to be here, but I'm looking
for the words. I suspect I just missed something, but clarification
would be appreciated.
Cheers,
Bill
--
Bill Long longb at cray.com
Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc., 1340 Mendota Heights Rd., Mendota Heights, MN, 55120
More information about the J3
mailing list