Van writes:
> Loren's example of a useful role for GO TO, viz. "do P if X is not in
> the set S", wherein S is represented by a list or a sequence of array
> elements, is exactly the reason I have been asking, since about 1986,
> to have two things: A block construct that doesn't do anything other
> than provide a place for a construct label, and allowing the label on
> EXIT to be on any kind of construct, not only a DO construct. For
> compatibility, an EXIT statement with no construct label would still
> refer to the most closely containing DO construct, not the most
> closely containing construct even if it's not a DO construct.
I suppose the poor man's way to do this is with a one-trip do loop:
INTEGER :: DUMMY
BLOCK_LABEL: DO, DUMMY = 1, 1, 1
...
END DO BLOCK_LABEL
I suppose one could write "BLOCK" in the code then globally replace this
with "DO, DUMMY = 1, 1, 1", ditto for "END BLOCK" and "END DO".
Not elegant, but a) is this the functionality needed (or am I missing
something) and b) this could easily be done automatically immediately
before compile.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|