Being able to do ["foo", "boo"] + "moo", is a powerful bit of LSL, and Lua can't do that by default. As someone who's never touched Lua before tonight, it was delightfully easy to add that behavior back in, and might be something very useful for others.
local mt = {
__tostring = function(a)
return ll.DumpList2String(a, " ")
end,
__add = function(a, b)
if type(b) == "table" then
for _, v in ipairs(b) do a[#a+1]=v end
else
a[#a+1]=b
end
return a
end
}
function ct(tbl)
return setmetatable(tbl or {}, mt)
end
-- Usage:
ll.OwnerSay("=================")
local t = ct() + {1, 2} + {3, 4} + "hi"
ll.OwnerSay(`{tostring(t)}`)