(j3.2006) defining a type with no components

Kurt W Hirchert hirchert
Thu Apr 17 10:27:19 EDT 2014


On 4/17/2014 8:44 AM, Dan Nagle wrote:
> On Apr 16, 2014, at 17:34 , Malcolm Cohen <malcolm at NAG-J.CO.JP> wrote:
>
>> Try [452:34].  This answers all the definition questions.
> Which reads ?A derived-type scalar object is defined if and only if
> all its nonpointer components are defined.?
>
> So since foo has no nonpointer components, they?re all defined.
>
> It seems just as logical to say they?re all not defined,
> or all green, or all not green.
>
> Is there a more clear statement I missed?
I don't think so.  The fact that all the nonpointer components are 
undefined and all the nonpointer components are green is irrelevant, 
since we have no definition based on all elements being undefined or 
green.  The point is that the condition in [452:34] is true.

This is analogous logic to [452:33] implying that zero-sized arrays are 
always defined and [452:35] implying that zero-length strings are always 
defined.  Because reasoning about null sets can sometimes be 
unintuitive, we made this statement this implication explicit at 
[452:38] (and similarly dealt with a lot of "edge cases" in the 
specifications of the intrinsics).   It would not be unreasonable to add 
derived-type objects with no nonpointer components to [452:38] so no 
reader would draw an incorrect inference from its absence, but strictly 
speaking this is not necessary; [452:34] is clear!

-Kurt



More information about the J3 mailing list