I was messing around with Lua yesterday and stumbled upon the 'newproxy' function.
http://wiki.roblox.com/index.php?title=Function_dump/Basic_functions#newproxy
I kind of understand it, but I'm not sure how it is useful. I know it creates a blank userdata object with a metatable attached (if the argument is true).
How it newproxy useful? Here is an example of what I did while messing around with it:
local proxy = newproxy(true)
local metatable = getmetatable(proxy)
metatable.__index = function(array, key) print(array, key) end
local y = proxy[100]
--[[
OUTPUT:
userdata: 0x443ad4b4 100
]]
newproxy
was deprecated in Lua 5.1 and removed in Lua 5.2. – Journal