Skip to content

Proxy

Userdata constructor similar to newproxy()

new

-- Creates a userdata with the index "foo" equal to "bar"
local userdata = Proxy.new(
    {
        foo = "bar"
    },
    {
        -- Set metamethods here
    }
)

Metamethods

Warning

The metamethods __eq, __lt, and __le do not work on userdatas. It should be noted __len can only be used on the userdata and not the metatable.

These metamethods can be set in the 2nd argument of Proxy.new()

Name
__metatable
__index
__newindex
__tostring
__call
__concat
__unm
__add
__sub
__mul
__div
__mod
__pow
__len

For more details refer to the Developer Hub