Skip to content

Instantly share code, notes, and snippets.

@nefftd
Created October 7, 2014 16:44
Show Gist options
  • Select an option

  • Save nefftd/7cb4368fc05840b4e446 to your computer and use it in GitHub Desktop.

Select an option

Save nefftd/7cb4368fc05840b4e446 to your computer and use it in GitHub Desktop.
local mt,mt_proxy = {},{}
setmetatable(mt_proxy,{ __index = mt })
mt.__metatable = mt_proxy
test = {}
setmetatable(test,mt)
-- add `__newindex = mt` to line 2 for full read/write
-- or make __newindex a special filtering function to allow writing only some metamethods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment