[J3] Consideration of Paper 18-242 at Meeting 218 (Was: 18-242)

Vipul Parekh parekhvs at gmail.com
Mon Dec 3 15:12:17 EST 2018


On Mon, Dec 3, 2018 at 1:45 PM Bill Long via J3
<j3 at mailman.j3-fortran.org> wrote:
>
>
> > On Dec 1, 2018, at 2:29 PM, Van Snyder via J3 <j3 at mailman.j3-fortran.org> wrote:
> >
> >
> > A loop-control declared in the statement would be a construct entity.
> > That's the point!  It's not an accidental defect.
>
> But the do-variable in an ordinary DO look is NOT a construct entity. The DO semantics depend on this.   I was not part of the JoR discussion, but it seems you are really proposing a whole new, separate form of DO.   For example:
>
> integer(4) :: i
>
> do integer(8) :: i = n,m
>    if (a(i) < 0) exit
> end do
>
> call histo(i)  ! Corresponding dummy variable to i  is integer(4)
>
..
> I think I have to agree with the JoR decision.  The benefit vs confusion balance favors not adding this feature.
> ..


I totally agree with Van on the essential point about addressing the
declaration of loop-variable s, there is indeed a very troublesome
incongruity in the language given of course its long legacy but
possibly also due to inadequate attention to what may be achievable if
only open and engaged discussion among all motivated members were
permitted rather than what appears to have been,

Unlike what Bill explains above, my own (likely limited) understanding
of paper 18-242 is it would lead to considerable improvement in the
language.  It will NOT require supporting "a whole new, separate form
of DO" but rather what would be a highly welcome simplification of an
EXISTING facility i.e., with the DO CONCURRENT construct.  An option
can be the CONCURRENT keyword is made optional, it is left to
circumstances where the coder explicitly informs the processor to
consider concurrent execution of the DO but when CONCURRENT is absent
in the header, the coder is indicating to the processor the loop
definitely must not execute concurrently.

To take Bill's example, I would think the supported syntax in a future
language revision could be:

--- begin example ---
integer(4) :: i

do ( integer(8) :: i = n:m ) !<-- NOTE the parenthesis around the loop
header and the colon in control spec as in n:m instead of n,m
! object i is now a construct entity
   if (a(i) < 0) exit
end do

call histo(i) !<-- Here i is just a variable in the scope of this
instruction abiding by the existing rules for its definition
--- end example ---

So notice in my modified example above, the syntax of the loop header
is effectively the same as that with DO CONCURRENT but that the
CONCURRENT keyword has been dropped, effectively indicating the loop
is to be executed sequentially.

An option such as what I show here is something that can address the
purport of the 18-242 paper with dropping it summarily while also
allaying any concerns of new confusion with the good old DO loop,
concerns I find rather amusing and misplaced considering the confusion
that has been unleashed since the introduction of DO CONCURRENT in the
language.

Regards,
Vipul Parekh


More information about the J3 mailing list