I wrote:
> > 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....
and Phillip Helbig wrote:
> 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.
Phillip hasn't missed anything. The primary objections are that
DO DUMMY = 1,1,1 is ugly, and using a preprocessor to replace DO BLOCK
with DO DUMMY = 1,1,1 is mildly irritating. There's also the problem
of having these constructs nested, so the preprocessor would need to
invent dummy induction variables. I.e., a simple search-and-replace
done by "sed" or equivalent wouldn't work: a more capable preprocessor
is necessary.
Best regards,
Van Snyder
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|