[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Feature request: enhanced break
- From: Dirk Laurie <dirk.laurie@...>
- Date: Mon, 24 Nov 2014 08:39:46 +0200
Optional integer constant after "break" specifies number of enclosing
loops to break. `break 1` means the same as `break` without a number.
Example: find an item in a table of lists, with shortcut exit from a list.
for k,a in pairs(t) do
for n,b in ipairs(a) do
if futile(b) then break end
if found(b) then row,col = k,n; break 2; end
end
end