> Imagine:

My eyes! I had a bad dream, Mommy!

That violates every precept of encapsulation and information hiding. A 
subroutine should no be tinkering with the caller's environment except in very 
structured ways, e.g., return codes, signals. Having code outside of a loop 
dealing with the loop is an invitation to disaster. But it's not my dog.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Assembler List [[email protected]] on behalf 
of Paul Gilmartin [[email protected]]
Sent: Tuesday, June 2, 2020 1:35 PM
To: [email protected]
Subject: Re: z/OS HLASM: EQU for statement labels

On 2020-06-02, at 11:21:23, Seymour J Metz wrote:
>
> SIGNAL in PL/I is well behaved; in REXX, not so much.
>
> I like REXX, but it would have been much cleaner had iterate and leave used a 
> label on the do rather than using the control variable.
>
Yes.

> It would also have been cleaner had there been a proper GOTO so that people 
> wouldn't shoot themselves in the foot misusing SIGNAL as an ersatz goto.
>
> What are long-ITERATE and long-LEAVE?
>
Imagine:

DO LOOP = 1
    CALL PROC
    epilogue
    END LOOP

...

PROC: PROCEDURE EXPOSE LOOP
    stuff
    IF boolean THEN ITERATE LOOP  /* bypass epilogue.      */
    more stuff
    RETURN                        /* to perform epilogue.  */

-- gil

Reply via email to