aboutsummaryrefslogtreecommitdiff
path: root/containers.moon
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.moon
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.moon')
-rw-r--r--containers.moon11
1 files changed, 4 insertions, 7 deletions
diff --git a/containers.moon b/containers.moon
index 990a741..0c881cd 100644
--- a/containers.moon
+++ b/containers.moon
@@ -196,16 +196,13 @@ do
i = tmp[1]
result[#result+1] = tmp
return List(result)
+ from_1_to: sub, from: sub,
+ character: (i)=> sub(@, i, i)
setmetatable(text_methods, {__index:string2})
-
+ setmetatable(string2, {__index:error})
getmetatable("").__methods = text_methods
- getmetatable("").__index = (i)=>
- -- Use [] for accessing text characters, or s[{3,4}] for s:sub(3,4)
- if type(i) == 'number' then return sub(@, i, i)
- elseif type(i) == 'table' then return sub(@, i[1], i[2])
- else return text_methods[i]
-
+ getmetatable("").__index = text_methods
getmetatable("").__add = (x)=> tostring(@)..tostring(x)
return {:List, :Dict}