diff options
-rw-r--r-- | util/set.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/util/set.lua b/util/set.lua index 69dfef5d..a2704f6c 100644 --- a/util/set.lua +++ b/util/set.lua @@ -189,6 +189,15 @@ function set_mt.__tostring(set) return t_concat(s, ", "); end +function set_mt.__freeze(set) + local s = {}; + for item in pairs(set._items) do + s[#s + 1] = item; + end + return s; +end + + return { new = new; is_set = is_set; |