diff options
Diffstat (limited to 'util/set.lua')
-rw-r--r-- | util/set.lua | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/util/set.lua b/util/set.lua index 69dfef5d..dbff28b4 100644 --- a/util/set.lua +++ b/util/set.lua @@ -186,9 +186,18 @@ function set_mt.__tostring(set) for item in pairs(items) do s[#s+1] = tostring(item); end - return t_concat(s, ", "); + 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; |