From 7f47d4204039258cec78c767f489b7809b4257ff Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 17 Nov 2018 14:38:05 -0800 Subject: In-progress (but working) overhaul of some elements including: function calls, lib/thing.nom API, multi-assignments, varargs, etc. --- containers.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'containers.lua') diff --git a/containers.lua b/containers.lua index f33c2ff..6417f2e 100644 --- a/containers.lua +++ b/containers.lua @@ -491,21 +491,21 @@ do result[#result + 1] = tmp end return List(result) + end, + from_1_to = sub, + from = sub, + character = function(self, i) + return sub(self, i, i) end } setmetatable(text_methods, { __index = string2 }) + setmetatable(string2, { + __index = error + }) getmetatable("").__methods = text_methods - getmetatable("").__index = function(self, i) - if type(i) == 'number' then - return sub(self, i, i) - elseif type(i) == 'table' then - return sub(self, i[1], i[2]) - else - return text_methods[i] - end - end + getmetatable("").__index = text_methods getmetatable("").__add = function(self, x) return tostring(self) .. tostring(x) end -- cgit v1.2.3