Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _ = setmetatable({}, {
- __call = function() end,
- __pow = function(self, def)
- getfenv()[def[1]] = (
- type(def[2]) == "function" and setmetatable({def[2]},{
- __index = function(self2, other2)
- self2[1](unpack(other2))
- end
- }) or def[2]
- )
- end
- })
- _(_ ^ {"sum", function(...)
- _(_ ^ {"x", 0})
- for i = 1, #({...}) do
- x = x + ({...})[i]
- end
- print(x)
- end})
- _(sum[{5, 10, 15}])
Advertisement
Add Comment
Please, Sign In to add comment