Diff

util/array.lua @ 5564:1292643ac498

util.array: Wrap tostring() output in {} (otherwise empty arrays print as "").
author Waqas Hussain <waqas20@gmail.com>
date Tue, 07 May 2013 10:41:03 -0400
parent 5085:cbc7eb5cfa8c
child 5776:bd0ff8ae98a8
line wrap: on
line diff
--- a/util/array.lua	Mon May 06 19:43:59 2013 -0400
+++ b/util/array.lua	Tue May 07 10:41:03 2013 -0400
@@ -17,7 +17,7 @@
 local array = {};
 local array_base = {};
 local array_methods = {};
-local array_mt = { __index = array_methods, __tostring = function (array) return array:concat(", "); end };
+local array_mt = { __index = array_methods, __tostring = function (array) return "{"..array:concat(", ").."}"; end };
 
 local function new_array(self, t, _s, _var)
 	if type(t) == "function" then -- Assume iterator