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.moon | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'containers.moon') 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} -- cgit v1.2.3