allow calling number

This commit is contained in:
2020-08-31 16:01:45 +01:00
parent 6a3dc8e774
commit aebd8b2d34
2 changed files with 9 additions and 2 deletions

View File

@@ -1370,6 +1370,13 @@ function func_funcs.address(x) return (string.match(tostring(x), "%w+$")) end
-- TODO: implement alternative mathematics.
local num_funcs = {}
local num_mt = {__index=num_funcs}
num_mt.__call = function(x, ...)
local out = x
for _, y in pairs {...} do
out = out + y
end
return out
end
if debug then debug.setmetatable(0, num_mt) end
function num_funcs.tostring(x) return tostring(x) end
function num_funcs.isNaN(x) return x ~= x end