[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 4.0 (alpha) now available
- From: "Russell Y. Webb" <rw20@...>
- Date: Wed, 3 May 2000 18:53:52 -0700
>Up to now the rules were: Every undeclared variable is a global. If you
>want locals you have to define them. Now you have the extension: unless
>it's the iteration var of a for loop, then it's always a local only visible
>within the body of the for-loop. And if you think that consistency has
>a higher priority then niceness it looks wrong *g*
Having programmed in python a lot, I definitely like the python style auto
locals.
for key in table:
do_something
I admit that the exception to the variables defaulting to global rule is
strange, but then I've always found defaulting to global creation strange
to begin with (another and old debate).
>I'm not a fan of gotos but sometimes they are useful (I'm not asking
>for them in lua). But labeled breaks are a nuisance. First you
>have to invent silly names (L1,L2,L3). Then you don't know where
>to write them (indented, left flushed, ...) and at last, if you
>see some "break foo" you have to search for this damned label to
>see what loop you leave. A "break 2" gives you a direct context,
>and you don't have to invent a label-syntax. Luiz Henrique once
>said, that you don't have to change the break statement if you
>insert another intermediate loop but IMHO you could find similar
>examples where a leveled break is easier. That should not be
>the point to base ones decision on (hmm... sounds strange *g*).
Personally I can't wait to start using break. Labeled breaks aren't on my
wish list though but I guess they remove the most pressing need for goto.
I'd rather have simple breaks and goto. That way you can goto error
handling at the bottom of the routine (I'd rather have exceptions). But, I
can live with labeled breaks.
Russ