(j3.2006) C713 question

Van Snyder Van.Snyder
Tue Mar 31 18:33:30 EDT 2009


On Tue, 2009-03-31 at 14:21 -0700, Bill Long wrote:
> 
> Van Snyder wrote:
> > C713 at [09-007r2:155:4 7.2.1.1] says that the <variable> in an
> > <assignment-stmt> cannot be a whole assumed-size array.
> >
> > It would seem to be OK in the case of defined assignment.
> >   
> 
> Not of the defined assignment subroutine is elemental.  You still have 
> the problem of not knowing the actual size of the array.

Elemental subroutines aren't allowed to have assumed-size arrays as
actual arguments because that would require their shape, and
assumed-size arrays are not allowed to appear in contexts that require
their shape [09-007r1:96:15].  So that red herring is off the table
(which I thought was too obvious to mention in the original message).

> > Did we intend this?
> >   
> 
> I assume so.  Even if the defined assignment subroutine has array 
> arguments, how do you declare the argument in the subroutine - as 
> assumed-size again?

It has to be declared assumed size because otherwise the actual
argument's shape would be required at references, and that's prohibited.

>   Just transferred the problem to a new place. 
> Otherwise, I don't know how you would decide on the size of the array.

This is an argument for prohibiting assumed-size arrays to be actual
arguments to any subroutine ... but we allow that.

If one does know how to determine how much of an assumed-size array to
use, why not...?

> Cheers,
> Bill
> 
> > Does this need to be decided by an interp, or would applying it only for
> > intrinsic assignment be a simple new feature?
> >
> > Van Snyder
> >
> >
> > _______________________________________________
> > J3 mailing list
> > J3 at j3-fortran.org
> > http://j3-fortran.org/mailman/listinfo/j3
> >   
> 




More information about the J3 mailing list