title: One loop for iterating through multiple Lua tables
body: <p>Is it possible to iterate through multiple Lua tables with the same loop?</p>
  
  <p>For looping through indexed tables I can do something like this:</p>
  
  <pre><code>local t1 = {"a", "b", "c"}
  local t2 = {"d", "e", "f"}
  
  local num = #t1+#t2
  for i=1, num, do
      local j
      local val
      if i &lt;= #t1 then
          j = i
          val = t1[j]
      else
          j = i-#t1
          val = t2[j]
      end
  
      -- Do stuff
  end
  </code></pre>
  
  <p>but how about key-value tables?</p>
  
  <p>E.g. something like this:</p>
  
  <pre><code>local t1 = {a="a", b="b", c="c"}
  local t2 = {d="d", e="e", f="f"}
  
  for key, val in pairs(t1) or pairs(t2) do
      print(key..":  '"..val.."'")
  end
  </code></pre>
  
  <p>should result in this:</p>
  
  <pre><code>a:  'a'
  b:  'b'
  c:  'c'
  d:  'd'
  e:  'e'
  f:  'f'
  </code></pre>