Software /
code /
prosody
Comparison
util/array.lua @ 9528:1af7cc3b9747
util.array: Break long line
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 19 Oct 2018 13:31:00 +0100 |
parent | 9487:4e38121a349d |
child | 9529:6a1e7723208b |
comparison
equal
deleted
inserted
replaced
9527:ced174f29d9a | 9528:1af7cc3b9747 |
---|---|
17 local type = type; | 17 local type = type; |
18 | 18 |
19 local array = {}; | 19 local array = {}; |
20 local array_base = {}; | 20 local array_base = {}; |
21 local array_methods = {}; | 21 local array_methods = {}; |
22 local array_mt = { __index = array_methods, __name = "array", __tostring = function (self) return "{"..self:concat(", ").."}"; end }; | 22 local array_mt = { |
23 __index = array_methods; | |
24 __name = "array"; | |
25 __tostring = function (self) return "{"..self:concat(", ").."}"; end; | |
26 }; | |
23 | 27 |
24 function array_mt:__freeze() return self; end | 28 function array_mt:__freeze() return self; end |
25 | 29 |
26 local function new_array(self, t, _s, _var) | 30 local function new_array(self, t, _s, _var) |
27 if type(t) == "function" then -- Assume iterator | 31 if type(t) == "function" then -- Assume iterator |