Changeset

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
parents 5563:678867c552d1
children 5565:6dd806829226
files util/array.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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