On Thu, 11 Mar 2004 [log in to unmask] wrote:
> > On Mar 11, 2004, at 9:48 AM, Renchi Raju wrote:
> > > maybe this has been suggested (and rejected) before. but how about
> > > havingsomething similar to implicit statements.
> > > for eg:
> > > implicit real_kind(selected_real_kind(12,30))
> One of the problems is that after you do this, it's not obvious how to
> declare variables or functions, or write literals, with the default kind.
> This may not be much of a problem for real or complex, but would be a
> significant problem for integers, because variables that return information
> from allocate, deallocate and input/output statements are expected to be
> default integers. One might think "just let them be any kind" but this
> puts a substantial burden on the processor, and may sometimes result in
> impossibilities. For example, if a processor provides a kind for what
> amounts to the equivalent of a C signed char -- with range -128:127 --
> and the processor needs to return a value with a greater magnitude, what
> happens?
from what i understand from what others are complaining about (including
me) is the need to specify kind for literals for real/complex types not
of the default type. i also agree it might sound too restrictive if you
specify it only for real/complex types. to accomodate default kind for
integer/real/complex there could be special kinds
real_kind_default / interger_kind_default. and the standard could say
specifically (as i guess it might be doing now) that the status arguments
and others for intrinsic procedures/functions that the kind needs to be
default kind and it should be easy for a compiler to flag errors by
looking at the kind of such arguments (similar to interfaced procedures).
if one doesn't change the default for a type, then all that type
literals/variables will be of the default type.
renchi
|