lua-users home
lua-l archive

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


* Roberto Ierusalimschy:

> Any comment about this?
>
>   http://lua-users.org/lists/lua-l/2005-09/msg00548.html

"until" could have been "break if", and the "repeat ... until exp"
could have been "repeat ... break if exp end", where "repeat ... end"
is an endless loop.

This is the way Ada addresses the scoping issue.  It hasn't got much
choice, though, because Ada blocks cannot contain variable
declarations, and the variable would be out of scope at the end of the
loop.  (Ada hasn't got "continue", either, but there's a "goto".
Looking at my small (by Ada standards) code base, I use goto for two
purposes: emulating "continue" in line-oriented parsers, and retrying
a computation from an exception handler.  "exit when" (the "break if"
equivalent) is much more common.)