lua-users home
lua-l archive

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

I'm not sure this is needed, but if other people disagree :) then I think
the Perl-esque idea of breaking out to a labelled statement is the way to

The problem with using numeric levels is that refactoring the code and
changing the number of nested scopes means looking for and changing any
"break N" statements, which I think is a likely source of tricky-to-debug

-----Original Message-----
[] On Behalf Of Karel Tuma

hi listers,

i've found myself doing lot of miserable things today, due to inability of
to simply break out of multiple nested breakable scopes in one statement.

finding nothing useful in powerpatches archive i wrote this rather naive
and unintrusive patch - so there is generally no reason why it shouldn't
but i've tested it extensively only with various for/while nested loops.

while foo do
	while bar do
		if baz then eek() break 2 end