diff --git a/set.lua b/set.lua index 5b480cd..4cd306f 100644 --- a/set.lua +++ b/set.lua @@ -66,6 +66,15 @@ function set:values_readonly() return self._ordered end +--convert to an ordered table, destroying set-like properties +--and deliberately disabling the initial set object +function set:to_table() + local r = self._ordered + self._ordered = nil + self._keyed = nil + return r +end + --modifying operations --add all the elements present in the other set