(j3.2006) 5.4.7p2 goes a little bit too far

Van Snyder Van.Snyder
Mon Jul 22 17:08:30 EDT 2013


On Mon, 2013-07-22 at 16:30 +0900, Malcolm Cohen wrote:
> 
> >F08/0062 established that it would be onerous to require a processor to
> >initialize part of an object using default initialization and part using
> >explicit initialization in a DATA statement.  I interpreted this to mean
> >"some components of...," not "some array elements of...," since that's
> >how Tobias posed the question.
> 
> Sorry, I do not see how an F2008 interpretation asked in 2012 "established" what 
> we intended in Fortran 95.  Nor do I see how over-interpreting the wording of 
> that explanation is likely to lead to good things.  Obviously an array element 
> is "part of" an array object...
> 
> >  A question Tobias didn't ask was whether
> >we intended to prohibit this:
> >
> >  type(t) :: B(3)
> >  data B(2) / t(2,39.0) /
> >
> >which doesn't impose the burden contemplated by F08/0062.
> 
> Well it does impose essentially the same burden, and does violate the first 
> sentence of the explanation.

The second sentence of the explanation is "It was considered to be a
burden on processors to be required to initialize some parts of a
structure using default initialization, and other parts of it
explicitly."

Subclause 1.3.140 defines a structure as "a scalar object of derived
type."

> One might conjecture that asking this question with an array element would get 
> precisely the same response as asking with a component: it is not conforming and 
> we did it deliberately, to reduce the burden on the processor.

F08/0062 seems pretty obviously to me to be saying that "parts of a
structure" in 5.4.7p2 was aimed at structures, not arrays.

There is no problem with

  real :: A(10)
  data a(5) / 42.0 /

This flies in the face of the first sentence of F08/0062: "The intention
was that an object be initialized entirely in a type declaration
statement...."

So which was it in F08/0062: components of structures, or elements of
arrays?  I think clearly the former.





More information about the J3 mailing list