(j3.2006) Question about Comment GB20 on CFI_is_contiguous

Bill Long longb
Wed Oct 5 16:29:32 EDT 2011



On 10/4/11 2:28 AM, Malcolm Cohen wrote:
> Bill Long wrote:
>> I see two general cases where using CFI_is_contiguous would be interesting.
>
> These are astonishingly non-general very niche cases.  If these are the only two
> "general" cases then the function is completely pointless.  I for one can
> imagine many generally useful cases so I do not agree for a moment that you have
> characterised the universe of discourse.
>
> You have completely not refuted any of my points, like an array section of 1
> element is contiguous, so why on earth would you think an array element is not
> contiguous.  We are talking A(I:I) vs A(I) here.
>

This is the situation with the current definition of contiguous in the 
standard.  I think it is reasonable at this stage to be consistent with 
the existing F2008 text.  If, later, we want to globally change the 
rules to make a scalar "contiguous", we can consider that.  The TS text 
would be integrated at that time and changed concurrently.


> To reiterate:
> The preferred answer for a scalar is TRUE, as per the UK comment.
>

I think it is counter productive to call CFI_is_contiguous for a scalar, 
so disallowing that seems better.

> The not preferred but grumblingly acceptable for me (not speaking for the rest
> of the UK here) would be that it is not valid to call CFI_is_contiguous on a
> scalar.
>

This option, along with another post concerning allocatable and pointer 
would then be:

In dv, change "the object." to "an array. The base_addr member of the C 
descriptor shall not be a null pointer."
{First edit makes it parallel to the Description (and IS_CONTIGUOUS in 
Fortran). Added sentence disallows unallocated allocatable and 
disassociated pointers.}

In Result Value, change "object" to "array".

Cheers,
Bill


> Returning FALSE, or returning a "random" value that might be FALSE, is
> absolutely not acceptable.
>
> Please do not make me regret defending the inclusion of CFI_is_contiguous in the
> TR.
>
> Cheers,

-- 
Bill Long                                           longb at cray.com
Fortran Technical Support    &                 voice: 651-605-9024
Bioinformatics Software Development            fax:   651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101





More information about the J3 mailing list