(j3.2006) 08-267

Van Snyder Van.Snyder
Tue Sep 23 17:41:58 EDT 2008

On Tue, 2008-09-23 at 13:53 -0700, Aleksandar Donev wrote:
> Van (and Jim),
> > If one can't reference a coindexed object that is polymorphic, or that
> > has an allocatable ultimate component that is polymorphic or has a
> > length parameter, why allow such objects to have codimensions in the
> > first place?
> I believe you and Jim are both missing an essential point. You *can* reference 
> components of such object since those are not polymorphic.
> class(my_type), intent(in) :: x[*]
> write(*,*) x[1]%my_counter

Interesting.  But C616a would apparently prohibit

  select type ( x[1] )
  type is ( my_extension )
    print *, x%more_stuff
  end select


  call S ( x[1] )
  subroutine S
    class(my_type), intent(in) :: x
    select type ( x )
    type is ( my_extension )
      print *, x%more_stuff
    end select
  end subroutine S

So, although a co-indexed object can be polymorphic, you can't get at
any of the components of anything other than it's declared type.

> I think this leaves plenty of "reasonable" uses for co-arrays of extensible 
> type, even if it it may not appear too often.
> Best,
> Aleks

More information about the J3 mailing list