Rawset

From Pico-8 Wiki
Jump to navigation Jump to search
rawset( tbl, member, value )
Write to a table member, bypassing metamethods
tbl
The table whose member to modify.

member
The member to modify.

value
The member's new value.

When creating things like class objects, one often overrides metamethods like __index and __newindex with custom code, but might then need to write directly to the table without going through those overrides. This can be done with rawset().

See also