Ah, but SIGNAL does clean up resources., Not always the appropriate resources, 
but resources.

    do i=1 to 100
         foo
         SIGNAL bar
         baz
         bar: j=1
         end

That's part of "it does not have lexical scope,"


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

________________________________________
From: IBM Mainframe Discussion List [IBM-MAIN@LISTSERV.UA.EDU] on behalf of 
Paul Gilmartin [0000000433f07816-dmarc-requ...@listserv.ua.edu]
Sent: Sunday, June 7, 2020 10:48 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Goto Statements (was: COBOL Question)

On Sun, 7 Jun 2020 10:33:34 +0000, Seymour J Metz wrote:

>I generally get by with control structures like case (select/when), 
>if/elsif/when, iterate and leave, but I unashamedly use GOTO, when it is the 
>cleanest way to do something; I refuse to avoid a useful construct just 
>because it is not politically correct. In the case of COBOL,
>
Alas, Rexx lacks GOTO and SIGNAL fails to clean up resources,
largely a consequence of lacking lexical scope.

>I consider the out of line PERFORM to be far more dangerous. I have a similar 
>issue with REXX; it does not have lexical scope, and you can fall into a 
>procedure.
>
A noteworthy 1976 paper (behind a paywall):
    Software malpractice — a distasteful experience†
    https://onlinelibrary.wiley.com/doi/abs/10.1002/spe.4380060303

... describes the pitfall set by a (too) clever programmer's relying on
optimization by falling into procedures.

† In the day, I read it free in the University library.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to