Software /
code /
prosody
Changeset
13032:ea4923bebca9
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.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 06 Apr 2023 16:27:37 +0200 |
parents | 13031:1023c3faffac |
children | 13033:a863e4237b91 |
files | util/array.lua |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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