[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: proposal: state machine syntax also usable for continue / nested break
- From: David Manura <dm.lua@...>
- Date: Fri, 28 Jan 2011 00:09:21 -0500
On Fri, Jan 28, 2011 at 12:03 AM, David Manura <dm.lua@math2.org> wrote:
> I don't local variables can completely replace labels in the above
> proposal (as opposed to [1]). However, my above suggestion for
> implicitly naming variables could incorporate the loop variable name
> in the label. Therefore, :forfor: could be replaced with :kk: .
err, correction: don't -> don't think; naming variables -> naming
labels. In other words, this would be consistent with the proposed
semantics:
for kk, vv in pairs(tt) do
for k, v in pairs(t) do
if condition1 then break end -- same as `break :k:`
if condition2 then break :continue: end
if condition3 then break :redo: end
if condition4 then break :kk: end
end
end