# HG changeset patch # User Matthew Wild # Date 1240419822 -3600 # Node ID a82268d507fcf5cdd555ccbd7c97815091004c5f # Parent 4ead039747590e53fee4e13c3ba166c3cf078718 util.set: Add set.xor() to get a set consisting of items not in both sets diff -r 4ead03974759 -r a82268d507fc util/set.lua --- a/util/set.lua Wed Apr 22 18:03:02 2009 +0100 +++ b/util/set.lua Wed Apr 22 18:03:42 2009 +0100 @@ -141,4 +141,8 @@ return set; end +function xor(set1, set2) + return union(set1, set2) - intersection(set1, set2); +end + return _M;