On Tue, 10 Apr 2018 20:35:34 -0400, Tom Conley wrote:

>On 4/10/2018 7:14 PM, Phil Smith III wrote:
>
>> Seriously, I'm chary of doing something just to fit some arbitrary rule like
>> "more than n arguments is bad". This reminds me of the "GOTOs are bad": yes,
>> they often are, but there are plenty of cases where a simple GOTO makes the
>> code MUCH simpler. Taking it back to Rexx, use of SIGNAL for error handlers
>> is such a case. I'm sure this will set off a bunch of folks, ...
>
>> Yet folks say "Oooh, SIGNAL is like GOTO, and GOTO is unequivocally bad, so
>> I must not use SIGNAL". And this results in fugly, unreadable code.
>>
Don't forget multiple RETURNs.  I'll wrap an entire PROCEDURE in a DO and
use multiple LEAVEs to get to a single RETURN.

OTOH, we had a VM sysprog (now retired) who wrote wrapper EXECs using
almost entirely SIGNAL:
    SELECT
        WHEN ... SIGNAL
        WHEN ... SIGNAL
        WHEN ... SIGNAL
        WHEN ... SIGNAL
            ...
... then SIGNAL back to top-of-loop.  Ugh.  I suspect his mother was
traumatized during gestation by Assembler or FORTRAN.  And over-reliance
on SIGNAL precluded intelligent use of DO and CALL.

>Heck, I still get crap for using LEAVE and ITERATE.
>
Rexx, unlike many languages, allows labelling the target of LEAVE and
ITERATE with the name of the control variable.  (Sometimes I need to
force it with an otherwise otiose control variable.  This probably means
my DO is too big and should be refractured.)

And I dearly wish for longITERATE and longLEAVE whose targets could
be any control variable, possibly in an outer procedure, in scope at the
point of the ITERATE or LEAVE.

POSIX shell script and awk have no GOTO (AFAIK).  I've rarely missed it,
and never looked for it.

-- gil

----------------------------------------------------------------------
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