[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: New scoping rule for "repeat" and "continue" patch
- From: "Mark Meijer" <meijer78@...>
- Date: Thu, 29 Sep 2005 15:14:47 +0000
Indeed, leading to anti-self-documenting code. I've seen the same thing in
C, occasionally preceded with a comment like "this 'do' is only to allow
use of 'break´". I've always thought that it would be better to use a goto
in such cases, since (may I not be smitten by Djikstra's ghost) a 'goto'
a well-chosen label is easier to understand than a misused iteration
Having said that, I do not favour adding 'goto' to Lua.
Just as a side-note, isn't the do/end construct, as encountered throughout
the manual, PIL and representative LUA code for hiding local variables (i.e.
used solely to limit the scope of those variables, not for looping or
'goto'-ing), also a misused iteration construct? Not that I mind terribly
much, but if we're going into a discussion about principles... :P