title: How to get the complement of two Lua tables
body: <p>In Lua v. 5.2, how can I get the complement of two tables' keys that are all strings?</p>
  
  <p>Optimally, I'd like to have a function something like:</p>
  
  <pre><code>    table.complement ( t1, t2 )
  </code></pre>
  
  <p>... where the return is a table that is the complement of key/value pairs in table 1 and table 2. That is, the returned table contains only the keys that are not in both tables. </p>
  
  <p>The use case staring me in the face is a script for the NoteCase Pro outliner that will fetch a "before" list of unique sibling node IDs (22 chars each) before performing an operation that will split the current node into multiple sibling nodes, fetch a new "after" list of sibling node IDs, reduce that list to the complement of the two lists, then demote the newly-created nodes to become child nodes or the original current node in the hierarchy.  </p>