does __index tell you what the index is?
Yes. Its the value of the second parameter. The first parameter is the table itself, and if you use the colon syntax, you don’t need to write the first parameter.
local mt = {}
function mt:__index(index) -- could also be function mt.__index(self, index)
print(index)
end
local t = setmetatable({}, mt)
local a = t[1] -- 1 is printed, a will be nill.