aboutsummaryrefslogtreecommitdiff
path: root/containers.lua
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-11-17 14:38:05 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-11-17 14:39:08 -0800
commit7f47d4204039258cec78c767f489b7809b4257ff (patch)
treec8533068b75ab453accfe1f688705e9e94c9e279 /containers.lua
parent34a3dd22a4e132bd4e0fe3ce89831c3fe761d3d9 (diff)
In-progress (but working) overhaul of some elements including: function
calls, lib/thing.nom API, multi-assignments, varargs, etc.
Diffstat (limited to 'containers.lua')
-rw-r--r--containers.lua18
1 files changed, 9 insertions, 9 deletions
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