Re: bug in g95 with character arrays?
- From: nospam@xxxxxxxxxxxxx (Richard Maine)
- Date: Sat, 28 Jun 2008 10:26:18 -0700
glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx> wrote:
My first thought is that it should work for a DATA statement,
but now I am not even sure about that.
Depends what your referent is for "it". If you are referring to an array
constructor whose elements have different character lengths, then the
answer is twofold
1. Such array constructors are not allowed in the first place. Period.
Context is irrelevant.
2. Data statement values are required to be scalar anyway, so they can't
be array constructors, regardless of whether the array constructor is
valid or not.
If you are talking about character values in data statements having
different character length, then
1. There is no relationship among the different values in a data
statement, so there is no particular restriction on the
non-relationship. Each value is related only to its corresponding
data-statement-object.
2. Intrinsic conversion is allowed, so yes, that allows the character
lengths in the values to be diferent from the character length of the
data-statement object. That's also true of the other syntax of
initialization, by the way. The restriction in question relates only to
array constructors, independent of context. The array constructor
doesn't have to agree in character length with the variable being
initialized; it just has to be a valid array constructor in the first
place, with *SOME* well-defined length.
One might think that PARAMETER was different, but it
seems that it isn't.
One wouldn't think that if one realized that an array constructor is an
array constructor and is independent of context, like pretty much
everything else in expressions. *SURELY* you are aware of that kind of
issue in regards to precision; in fact, it is practically the same
issue, insomuch as kind and length are both type parameters.
--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.
- Follow-Ups:
- Re: bug in g95 with character arrays?
- From: glen herrmannsfeldt
- Re: bug in g95 with character arrays?
- References:
- bug in g95 with character arrays?
- From: wim
- Re: bug in g95 with character arrays?
- From: Richard Maine
- Re: bug in g95 with character arrays?
- From: glen herrmannsfeldt
- bug in g95 with character arrays?
- Prev by Date: Re: bug in g95 with character arrays?
- Next by Date: Re: Is it time to legitimise REAL*8 etc?
- Previous by thread: Re: bug in g95 with character arrays?
- Next by thread: Re: bug in g95 with character arrays?
- Index(es):
Relevant Pages
|