From a8a7be217a12b49d3530ae83ff1bb818dfab134b Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 6 Apr 2023 16:27:37 +0200 Subject: 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. --- util/array.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/array.lua') diff --git a/util/array.lua b/util/array.lua index 78c076d0..fd8dd8be 100644 --- a/util/array.lua +++ b/util/array.lua @@ -24,7 +24,7 @@ local array_methods = {}; 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 -- cgit v1.2.3