Yuari
Documentation
Docs/Metatables/iswritable

iswritable

Returns true when a table is not read-only.

Syntax

iswritable(table: table) -> boolean

Parameters

ParameterTypeDescription
tabletableThe table value used by the call.

Returns

TypeDescription
booleanTrue when a table is not read-only

Description

iswritable is part of the Metatables library. Metatable helpers operate below normal Lua protection: they read raw metatables, replace metamethods and inspect namecalls.

The call is a predicate: it inspects the current state and returns a boolean without modifying anything.

The aliases iswriteable(table) resolve to the same implementation.

Example

local t = {}
makereadonly(t)
print(iswritable(t)) -- false
makewriteable(t)
print(iswritable(t)) -- true

Notes

  • Aliases: iswriteable(table).
  • Metatable changes are applied directly to the live object.