lua-users home
lua-l archive

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


On Fri, Nov 19, 2010 at 10:46 PM, David Manura <dm.lua@math2.org> wrote:
>  function f()
>    local x
>    return function()
>      break x  -- could this even be allowed? (break across functions)
>    end
>  end
>  f()()()()()

err.. that should read more like

function f()
  for x=1,3 do local cont
    print(x)
    return function() break cont end
  end
end
f()()()()() -- > 1 2 3  (i.e. some type of coroutine)