Changeset

13033:a863e4237b91

util.set: Change tostring format to {a, b, c} Makes it easier to make out where the set starts and ends in cases where it may get embedded and tostring()-ed in a log message. { } taken over from util.array for consistency with some other systems syntax for Sets, e.g. Python
author Kim Alvefur <zash@zash.se>
date Thu, 06 Apr 2023 16:30:26 +0200
parents 13032:ea4923bebca9
children 13034:1387888a5596
files util/set.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/util/set.lua	Thu Apr 06 16:27:37 2023 +0200
+++ b/util/set.lua	Thu Apr 06 16:30:26 2023 +0200
@@ -186,7 +186,7 @@
 	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)