[TUHS] I can't drive 55: "GOTO considered harmful" 55th anniversary
arnold at skeeve.com
arnold at skeeve.com
Fri Mar 10 21:37:39 AEST 2023
Ralph Corderoy <ralph at inputplus.co.uk> wrote:
> Hi Werner,
>
> > after a stint in Java with its multilevel break...
>
> 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.
C predates the Bourne shell by several years. Remember too that the
C compiler had to fit in a small space; having multilevel or labelled
breaks requires more bookkeeping.
The idea of labelled loops is not at all new, Ada had them in the 80s
and it wasn't new then. IIRC Go also provides them.
Arnold
More information about the TUHS
mailing list