Re: Is it time to legitimise REAL*8 etc?



James Giles <jamesgiles@xxxxxxxxxxxxxxxx> wrote:

Well this is exacly the opposite of what Van Snyder told me
back when NON_KIND was removed as the keyword and LEN
was put in its place. He insisted that LEN type parameter were
only for string lengths and array sizes.

Sorry, but he was just wrong. Or maybe that was what he proposed. But it
sure is not what passed into the standard.

But you people need to get your stories straight.

Van and I have disagreed about more than a few things (though I have
much respect for him, including the fact that he is a *VERY* hard and
dilligent worker - makes disagreeing with him hard because he is really
persistent and will bury you in lots of material). That kind of thing is
why it is sometimes hard to explain the reasons why some things are so
other than that it is what got enough votes. What got enough votes to
get into the standard does not limit length parameters to lengths. To
the extent that you might get different answers from Van and me, the
definitive answer is in reading the standard itself. I don't think
you'll find any such restriction.

You will find that length type parameters can be used for lengths. But
you won't find that they can't be used for anything else. You will find
specific other things that they can't be used for - such as
initialization expressions (which in turn limits lots of places). But
you certainly won't find anything like "can only be used for string
lengths and array sizes".

It turns out that there aren't many places where you can usefully use
them, but that's just a lack of places that fit rthaer than any explicit
restriction. One "interesting" form of use is as a readonly component.
You can define a length type parameter value when you create an object,
perhaps by allocation. You can then "read" the value much like a
component (indeed even using notation like that for a component), but as
it isn't actually a component,you can't change its value without
destroying and recreating the object.

--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.



Relevant Pages

  • Standards question regarding intrinsics with complex arguments
    ... these arguments) is not permitted by the Fortran 95 standard. ... 1501-510 Compilation successful for file test_cmplx.f90. ... I believe the code in question is standard Fortran95 and that the compiler is ... A kind type parameter ...
    (comp.lang.fortran)
  • Re: Invalid initialization expression?
    ... >> I think the standard could be read in such a way as to forbid ... parameter or array bound shall be specified in a prior ... inquiry function that depends on a type parameter or an array ...
    (comp.lang.fortran)