# HG changeset patch # User Kim Alvefur # Date 1680791257 -7200 # Node ID ea4923bebca9403f35346a6937b1a141d91fa7d8 # Parent 1023c3faffacb266565330895dfe350f25793a6e util.array: Change tostring format to [a,b,c] Arrays in Lua do use { } but since __tostring is often user-facing it seems sensible to use [ ] instead for consistency with many other systems; as well as to allow the {a,b,c} formatting to be used by util.set without being confused with util.array. diff -r 1023c3faffac -r ea4923bebca9 util/array.lua --- a/util/array.lua Thu Apr 06 15:03:45 2023 +0100 +++ b/util/array.lua Thu Apr 06 16:27:37 2023 +0200 @@ -24,7 +24,7 @@ local array_mt = { __index = array_methods; __name = "array"; - __tostring = function (self) return "{"..self:concat(", ").."}"; end; + __tostring = function (self) return "["..self:concat(", ").."]"; end; }; function array_mt:__freeze() return self; end