lua-users home
lua-l archive

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


Thiago Bastos wrote:
Honestly, the only time I missed 'continue' in Lua was the first time I tried to use it (and it was not there). Since then I've always found 'else' + indentation a reasonable alternative. If you have too many nested scopes, you should decompose your code in subroutines anyway. I'm a heavy C/C++ programmer (this means I'm used to 'continue') and the absence of 'continue' in Lua doesn't bother me at all. It may actually enforce good programming practices.

I also think the new scoping rule for 'repeat' is a good thing. Many times the control variable is not used anywhere else, but you'd have to declare it in the parent scope anyway. Lua allows you to 'encapsulate' this variable in the loop's scope, which is nice.

There already has been a number of threads on 'continue' in the past, with many pros and cons. I wouldn't like to restart that discussion once again. Our opinions on this matter are obviously different, and that's normal.
--
Shmuel