helloworld("print")

Nerdsniped by aarols meme HelloWorld(“print”) I had to try to do this in Lua and without debug.info.

I thought about the __call metamethod at first but then realized that I had to use __index:

setmetatable(_G, {
    __index = function(t, k)
        return function(target_func_name, ...)
            local func = _G[target_func_name]
            if type(func) == "function" then
                return func(k, ...)
            end
        end
    end
})


HelloWorld("print")
Enjoyed this post or have feedback?
← x4