Aliases

None.

Arguments

any
required
The value used by this operation.
table
The metatable to assign.

Returns

any
The supplied metatable argument, including nil when removing it.
Accepts nil unlike setrawmetatable. Returns one existing stack value (the mt argument in this implementation); do not assume it returns the object. Related types: Debug types & behavior.

Example