>>912
間違ってたらごめん
function each(t)
  local function e(t)
    local k, v = next(t)
    while k do
      if (type(v) == "table") then
        e(v)
      else
        coroutine.yield(v)
      end
      k, v = next(t, k)
    end
  end
  local co = coroutine.create(e)
  return function ()
    local f, s = coroutine.resume(co, t)
    return s
  end
end

local tbl, v = {{{1, 2},{3, 4}},{{5, 6},{{7, 8},{9, 10}}}}
for v in each(tbl) do
  print(v)
end