lua-users home
lua-l archive

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


Wednesday, June 10, 2009, 8:03:41 PM, Roberto wrote:
> Any comment about this?
>   http://lua-users.org/lists/lua-l/2005-09/msg00548.html

My take on that is that the scoping of repeat-until is non-orthogonal
to other blocks. Which in my opinion is a much less of a convenience
than having continue statement. If locals wouldn't leak outside of the
inner block or repeat-until, the example from that post would be a
non-issue. It would be detected by the compiler with no additional
code. But I see other people have already noticed this before I
managed to write it down.

Btw, if I may notice something... when discussing whether continue can
be easily simulated, the main poster-child is a plain "for" loop with
"continue" at a top-level "if", which is easily (albeit a bit ugly)
replaced with conditional for the rest of the loop. In reality I see
most needs for a continue in deeper levels of widely and deeply
branched if statements, where it is not possible to simulate it that
way. This leads to very complicated workarounds.

JM2C,
Alen