__index = b setmetatable(a, b) a.bar() -- 'bar'. 这样一来,b 既是a 的prototype,也是a 的metatable。将__index 指向另一个table 大概是它最简单也最普遍的用法, ...
確定! 回上一頁