lua-users home
lua-l archive

Re: labels [repost]

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


I found this in the archive but it does not seem to have been distributed.
(Has anyone received this?)
--lhf
 From: "Maciej Maczynski" <macmac@xdsnet.de>
 To: <lua-l@tecgraf.puc-rio.br>
 Subject: Re: labels
 Date: 2000年6月19日 08:56:09 -0000
 > 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

AltStyle によって変換されたページ (->オリジナル) /