lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


----- Original Message -----
From: Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>
To: Multiple recipients of list <lua-l@tecgraf.puc-rio.br>
Sent: Friday, June 16, 2000 8:12 PM
Subject: labels


> In 4.0 alpha we introduced "break" and labels for "break".
> We are now inclined towards removing these labels (but keeping "break".)
> Would anyone have a *good* use for labels?

Being heavily involved in project using Lua 3.2, I had no courage to switch
to 4.0, yet...
Some things in 4.0 are really great (e.g. multistate support, I missed), but
labels?

To be honest - having programming in various languages (C-mainly) for years
I have NO SINGLE situation when, in structural language, I needed label,
"break" (unless in C "switch" statement, of course), "continue" or any other
"cool" things.  Maybe that's because Pascal was my first language...
Anyway - if someone says "and what to do if you have 10 levels of loop and
you want to jump to 3-rd?" I answer "I don't have it".  I mean, many levels
of loops asks for defining new function.   In any language.  IMO thats good
programming practice.
Using all those "brothers of goto", as I call them, leads to unreadable code
and problems with debugging.

I can see only one situation, when labels can be usefull - in automatically
generated code.  In such case it really may be necessary to "break from
10-th lopp to  3-rd"

Best regards,
Maciej




> --lhf
>
>