LuaTable.opIndexAssign

Set a key-value pair this table or in a sub-table of this table.

struct LuaTable
@trusted
void
opIndexAssign
(
T
U...
)
(,)

Parameters

value T

value to set

args U

list of keys, where all keys but the last one should result in a table

Return Value

Type: void

t[k] = value, where t is the table for the second-to-last parameter in args, and k is the last parameter in args

Examples

lua["string", "empty"] = (in char[] s){ return s.length == 0; };
lua.doString(`assert(string.empty(""))`);

Meta