A little pointer on POINTER in data would be helpful

Steve Kargl sgk@troutmask.apl.washington.edu
Sat Mar 24 23:29:00 GMT 2018


On Sat, Mar 24, 2018 at 04:06:40PM -0700, Steve Kargl wrote:
> 
> > All specifications 
> > containing initial-data-target always show it to the right of "=>", not 
> > "=". It seems a perfectly reasonable interpretation to say that 
> > assignment with a data statement means "=", in which case 
> > initial-data-target cannot be used because it is only specified to the 
> > right of "=>". That said, your interpretation seems equally valid, 
> > provided we are extending the data statement to provide pointer 
> > assignment. I consider the data statement to be somewhat archaic, and 
> > would be disappointed at it being extended when the second example is so 
> > much cleaner.
> 
> Same here with the disappointment.  Well, I'm subscribed to
> the J3 mailing list.  I suppose I can send an email to the
> list and ask.  I'll also hunt around for the J3 paper, which
> provided the rationale and modification.

Well, I found N1828.pdf.  This is John Reid's "The new features
of Fortran 2008".   It has an entry for

  5.5 Pointer initialization

  A pointer may be initially associated with a target with the
  save attribute:
       type (entry), target, save :: bottom
       type (entry), pointer :: top => bottom

  and a pointer component may be default initialized as associated
  with a target.

There is no mention of DATA statement and initial-data-target change.

-- 
Steve



More information about the Fortran mailing list