[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: upcoming changes in Lua 5.2 [was Re: Location of a package]
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 27 Feb 2008 11:32:27 -0300
> Not replying to any particular post in this thread, but to the thread
> in general... As I read this, I have to admit I'm kind of confused to
> the logic of why a particular feature gets added to the language, and
> why some other doesn't: The local scope in repeat was something that
> didn't really add substantial usefulness - you can just declare the
> local in front of the loop. It was added. On the other hand, continue
> is something that is not easily fakeable in a general case. Even
> though it's being requested often and a lot, it's still not supported
> in the core language. Or am I missing some detail that makes this
> different (other than "single exit point" forcing, which doesn't have
> a ground in the language in general)?
At the time we "added" the local scope for repeat it really seemed
innocent. And it was not really an "added" "feature", we just changed a
scope rule. Unless the fact that it is different from other languages,
it should be neither simpler nor more complex than the old rule.
Continue, on the other hand, is a real feature. (It even changes the
syntax and the lexical.) Our main concern with "continue" is that there
are several other control structures that (in our view) are more or
less as important as "continue" and may even replace it. (E.g., break
with labels [as in Java] or even a more generic goto.) "continue" does
not seem more special than other control-structure mechanisms, except
that it is present in more languages. (Perl actually has two "continue"
statements, "next" and "redo". Both are useful.)
-- Roberto