Richard Hundt wrote: > local cmeta = debug.getmetatable(1LL) > local index = cmeta.__index > local cbase = { > lshift = function(a, b) > return bit.lshift(tonumber(a), tonumber(b)) > end > } > cmeta.__index = function(o, k) > return cbase[k] or index(o, k) > end That's not a good idea. This breaks internal tail calls used by cdata metamethods, it breaks cdata error reporting and the JIT compiler won't cope with that, too. The base metatable for cdata type is definitely off-limits. --Mike