(j3.2006) Future deprecation of overriding character length, dimension and codimension

Cohen Malcolm malcolm
Thu Feb 23 21:39:35 EST 2017


On Feb 22, 2017, at 7:37 PM, Cohen Malcolm <malcolm at nag-j.co.jp> wrote:
> A not uncommon style used to be to put all the length specs on the 
> variables
> instead of on the type name, e.g.
>
>          CHARACTER A*10,B*4,C*99

Bill Long replied:
>True, but that seems to be quite uncommon.

I do not think so.  I have seen a lot of code written like this.

>We already made character*n obsolescent

Which was a mistake at the time, and is still a mistake.  All it does is 
stop diligent compiler vendors from producing obsolescent messages by 
default because they'd be too annoying.  Maybe in another decade the *n form 
will have sufficiently fallen out of use to turn those on, but not yet.

>I think the same argument should apply to A*10.

Character length is more like an array bound than like a representation 
method.  Declaring the character length on the entity-decl makes perfect 
sense.

>as Steve pointed out, that was not his proposal.  Rather he wants to 
>prohibit specifying the type parameter or dimensions TWICE in the same 
>statement and having one override the other.

I sympathise, but omitting the LEN= gives you LEN=1.  There is no type-spec 
for character type that does not specify a length for it.

...
>Specifying a dimension attribute in a declaration does allow you to declare 
>several arrays of the same shape, which can be less error prone if the 
>dimension expressions are complicated.

This is less common than multiple character variables in the same scope with 
different length!  Not to mention that this is in fact the argument for 
permitting overrides: so that you can declare the type (which might have 
complicated type parameter expressions) and the dimensions of a pile of 
matrices, and override the array-spec for the additional variable for the 
column temp.

We are in danger here of veering into coding style territory.  We should 
steer well clear of embedding style guidelines in the standard, disguised as 
"obsolescent".

Cheers,
-- 
.............Malcolm Cohen, NAG Oxford/Tokyo. 




More information about the J3 mailing list