Home Contents | # setmetatable | Global | Lua Commands

## SYNOPSIS

setmetatable(table,metatable)

## DESCRIPTION

Sets the metatable for the given table. (You cannot change the metatable of other types from Lua, only from C.) If metatable is nil, removes the metatable of the given table.

## RETURN VALUE

This function returns table.

## ERRORS

If the original metatable has a "__metatable" field, raises an error.