[prev in list] [next in list] [prev in thread] [next in thread]
List: lua-l
Subject: Re: labels
From: "Maciej Maczynski" <macmac () xdsnet ! de>
Date: 2000-06-19 8:56:09
Message-ID: 002d01bfd9cc$373095f0$0cc8a8c0 () kari ! put ! poznan ! pl
[Download RAW message or body]
----- 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
>
>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic