Readonly

A readonly Lua table.

Description

The Readonly metatype represent a standard Lua table but with a protected content. It wraps a native table in order to make it readonly. The wrapped table can still be indexed as a usual table. However iterating requires to use the Readonly.pairs and Readonly.ipairs methods instead of the standard pairs and ipairs functions.

Note

The Readonly metatype is used in the pumas package in order to indicate data that should not be modified by users. This metatype is not meant to be directly instanciated by end-users.

See also

version.

Readonly.ipairs

This method behaves as the standard ipairs function. It returns an iterator over the elements of the native table.

Synopsis

Readonly:ipairs()

Arguments

None, except self.

Returns

Type Description
function Standard ipairs iterator over the native table.

See also

pairs.

Readonly.pairs

This method behaves as the standard pairs function. It returns an iterator over the elements of the native table.

Synopsis

Readonly:pairs()

Arguments

None, except self.

Returns

Type Description
function Standard pairs iterator over the native table.

See also

ipairs.