Print

Print


Aleksandar Donev writes:
 > I had thought that parametrized data-types were meant to be completely
 > "resolvable" at compile-time,

No.  That is the difference between kind and non-kind type parameters.
The kind ones are known at compile time (just like the kinds of the
f95 intrinsic types - thus the name).  The non-kind ones need not be
(much like the character len parameter in f95).  If you think of kind
type parameters as acting like the kind of real/integer/logical, and
the non-kind type parameters as acting like character len, you'll be
reasonably close.

 > the type:
 >
 > type :: point(dim)
 >     real :: coords(dim)
 > end type point
 >
 > contains no information internally about dim, but rather this is all
 > determined by the compiler at compile time (as for, say, explicit shape
 > dummy argument arrays).

No.  It is likely to be like assumed-length character.  Indeed,
assumed length character *IS* a case of this for an intrinsic type
(though with one or two extra quirks that didn't generalize well).
The dim is neither internal to the structure nor known at compile
time.  Those are not the only two options.  The dim is likely to be
passed as part of a "dope vector".

--
Richard Maine                |  Good judgment comes from experience;
[log in to unmask]   |  experience comes from bad judgment.
                             |        -- Mark Twain