comparison util/array.lua @ 5568:c463558bed45

Merge 0.9->trunk
author Matthew Wild <mwild1@gmail.com>
date Fri, 10 May 2013 10:46:27 +0100
parents 1292643ac498
children bd0ff8ae98a8
comparison
equal deleted inserted replaced
5560:cdb057244e44 5568:c463558bed45
15 local tostring = tostring; 15 local tostring = tostring;
16 16
17 local array = {}; 17 local array = {};
18 local array_base = {}; 18 local array_base = {};
19 local array_methods = {}; 19 local array_methods = {};
20 local array_mt = { __index = array_methods, __tostring = function (array) return array:concat(", "); end }; 20 local array_mt = { __index = array_methods, __tostring = function (array) return "{"..array:concat(", ").."}"; end };
21 21
22 local function new_array(self, t, _s, _var) 22 local function new_array(self, t, _s, _var)
23 if type(t) == "function" then -- Assume iterator 23 if type(t) == "function" then -- Assume iterator
24 t = self.collect(t, _s, _var); 24 t = self.collect(t, _s, _var);
25 end 25 end