- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the spirit of Run it up the flagpole and see if
anyone salutes, this proposes the following modest
language extension.
[name:] &
LOOP (triplet-spec [,triplet-spec]...[, mask-expr])
.
END LOOP [name]
Note the proposed syntax matches that of the FORALL
construct which was a DIGITAL F90 extension.
LOOP differs from FORALL in that any statement allowed
in the body of an ordinary DO loop is allowed within the
LOOP construct.
The first triplet-spec specifies the outermost loop.
Thus with two triplet-specs, the proposed construct
would execute exactly as the F77 construct:
DO i = i1, i2, i3 ! first triplet
DO j = j1, j2, j3 ! second triplet
IF (mask-expr) THEN
.
END IF
END DO
END DO
The keyword LOOP is tentative; other candidate keywords
include: DoFor, DoMask, DoOver, NEST, or VFDO. Compiler
writer to choose the keyword.
Arguments for this extension are: it is more F95-like;
it is a relatively common need; and it saves at least
one level of indentation. Anyone else think it worth
having?
anyone salutes, this proposes the following modest
language extension.
[name:] &
LOOP (triplet-spec [,triplet-spec]...[, mask-expr])
.
END LOOP [name]
Note the proposed syntax matches that of the FORALL
construct which was a DIGITAL F90 extension.
LOOP differs from FORALL in that any statement allowed
in the body of an ordinary DO loop is allowed within the
LOOP construct.
The first triplet-spec specifies the outermost loop.
Thus with two triplet-specs, the proposed construct
would execute exactly as the F77 construct:
DO i = i1, i2, i3 ! first triplet
DO j = j1, j2, j3 ! second triplet
IF (mask-expr) THEN
.
END IF
END DO
END DO
The keyword LOOP is tentative; other candidate keywords
include: DoFor, DoMask, DoOver, NEST, or VFDO. Compiler
writer to choose the keyword.
Arguments for this extension are: it is more F95-like;
it is a relatively common need; and it saves at least
one level of indentation. Anyone else think it worth
having?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
FYI - FORALL was a feature from High-Performance Fortran (HPF) that was subsequently adopted into Fortran 95. It wasn't our invention.
Steve
Steve
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page