(j3.2006) Syntax doesn't allow coindexed scalars?

Malcolm Cohen malcolm
Fri Jan 16 02:48:06 UTC 2009



Aleksandar Donev wrote:
> On Thursday 15 January 2009 17:24, Malcolm Cohen wrote:
>
>   
>> I seem to recall
>> that it was deliberately decided to disallow a whole-array
>> coreference (i.e. without a section-subscript-list)
>>     
> Yes, this is on purpose. As one example, consider:
>
> array[5]=... ! array is an allocatable coarray
>
> where the right hand side does not match the size of the coarray. It
> would need to cause remote reallocation.
Why?  We disabled reallocation for allocatable coarray components, so 
why would you expect reallocation of allocatable coarray named 
variables?  If we believed this justification, the logical outcome is to 
disallow intrinsic assignment of types containing allocatable coarrays, 
not to allow it but disable auto-reallocation.
>  For this, and a few other
> reasons (e.g., doing LBOUND(array[5])),
I see no problem with LBOUND.  On the contrary, if
   ARRAY(I,J)[5]
   ARRAY(:I,:J)[5]
are allowed (and of course they are), the processor already has the 
bounds information.  Refusing to tell the user does not lead to a good 
relationship.
>  we decided it was best to
> require the section subscript list. Tedious indeed, but there seems no
> real use in having a remote "whole array", and plenty of harm.
>   
And the decision has already caused harm to the standard as Van pointed 
out, and will continue to cause harm (by the added complication) to 
people trying to untangle our complicated syntax, compiler writers if 
they can be bothered to follow the standard (they have to write 
additional tests to conform to the standard, once we allowed coarray 
scalars there was no possibility of simpler syntax parsing), users who 
don't see the reason they should be forced to write tedious unnecessary 
additional text.

Cheers,
-- 
....................Malcolm Cohen, Nihon NAG, Tokyo.





More information about the J3 mailing list