[TUHS] I can't drive 55: "GOTO considered harmful" 55th anniversary
Ralph Corderoy
ralph at inputplus.co.uk
Fri Mar 10 22:11:34 AEST 2023
Hi Arnold,
> > > Remember too that the C compiler had to fit in a small space;
> > > having multilevel or labelled breaks requires more bookkeeping.
> >
> > Is it more bookkeeping than is already needed to handle the ends of
> > the nested for-loops, say?
>
> Yes, since you have to keep track of a label in a table somewhere that
> you can look up.
Oh, I think our wires are crossed.
I wrote:
> Given sh(1)'s break takes an optional number of loops to break out of,
> I'm surprised C stuck with just the single-level break.
In other words, ‘break 2’ works in sh but not in C.
You added labelled breaks; I wasn't asking if they upped the
housekeeping, just ‘break 2’.
--
Cheers, Ralph.
More information about the TUHS
mailing list