(j3.2006) Coindexed scalars, etc.

Van Snyder Van.Snyder
Tue Jan 20 14:57:33 EST 2009


On Mon, 2009-01-19 at 09:50 -0800, Bill Long wrote:
> >     What is C (J)%Z%RE%KIND[p] ?
> 
> Again, I think the %RE has to be at the end.

Without [p], the syntax allows this.  With [p], the KIND type parameter
would have to be a coarray.

We could add a constraint on R615 against the things we don't want
<designator> to be.  But why bother?  It just makes compilers messier.
What's the harm of asking the kind of the real part of a complex number?
There's no constraint against kind(real(c(j)%z)).  <type-param-inquiry>
is just an alternative syntax for an intrinsic function that the
compiler knows how to write, inline and optimize.

I want to emphasize again that component selectors, complex part
designators, and subscripted arrays are just intrinsic accessors, which
the compiler knows how to write, inline and optimize.  If we had allowed

real(c(j)%z) = real(c(j)%z) + 1.0

on equal footing with

c(j)%z%re = c(j)%z%re + 1.0

the duality would be obvious.

If component selection had been z(c(j)) as well as c(j)%z in 1986, the
duality would have been obvious.  (z would have been generic, to allow
program-defined accessors and functions named z, having arguments other
than the type of c.)

It's already obvious for arrays:

a(10) = a(10) + 1.0

Van





More information about the J3 mailing list