Yuari
Documentation
Docs/Metatables/isreadonly

isreadonly

Reads or sets a table read-only state.

Syntax

isreadonly(table: table) -> boolean

Parameters

ParameterTypeDescription
tabletableThe table value used by the call.

Returns

TypeDescription
booleanThe boolean result of the check.

Description

isreadonly 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 setreadonly(table, readonly) resolve to the same implementation.

Example

local t = {}
setreadonly(t, true)
print(isreadonly(t))

Notes

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