> Here's a method without dummy induction variables:
>
> BLOCK_LABEL: DO
>
> ...
>
> EXIT BLOCK_LABEL
> END DO BLOCK_LABEL
Right, but an extra line of code. Mine would be better for automatic
processing (though Van noted that it won't work simply for nested
blocks) whereas this is better if one reads the actual (as opposed to
processed) code.
Of course, the EXIT immediately before the end turns it from an infinite
to a one-trip loop; whether BLOCK_LABEL comes after EXIT (since EXIT
will by default exit the innermost loop) is I suppose a matter of taste.
The above doesn't need dummy induction variables, and of course DOES
need the label (as a rule) if they are to be nested (which will work
more easily since there is no need to come up with dummy induction
variables). For automatic processing, perhaps
EXIT BLOCK_LABEL; END DO BLOCK_LABEL
would be more efficient. I tend to dislike semicolons for putting more
than one statement on a line, but here they sort of belong together.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|