lua-users home
lua-l archive

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

Rici Lake wrote:


This sort of thing can be dealt with by using a tailcall, although that means expanding the for statement:


If you really really need to be able to 'return' as well, you can wrap the whole thing in a coroutine. I can't say I've ever encountered this situation, and there are probably better ways to handle it. However:

Isn't it awkward that one needs to invent workarounds such
as tail calls or coroutines or artificial extra loops just
to not use such a basic thing as the "continue" statement?

IIRC, the "continue" patch adds only 3 or so lines to the lua sources.
No, I don't consider "continue" as contamination of lua.
I very much hope to see "continue" as part of lua some time.