LuaDynamic.opDispatch

Perform a Lua method call on this object.

Performs a call similar to calling functions in Lua with the colon operator. The name string is looked up in this object and the result is called. This object is prepended to the arguments args.

struct LuaDynamic
opDispatch
(
string name
string file = __FILE__
uint line = __LINE__
Args...
)
(
Args args
)

Parameters

name

_name of method

args Args

additional arguments

Return Value

Type: LuaDynamic[]

All return values

Examples

auto luaString = lua.wrap!LuaDynamic("test");
auto results = luaString.gsub("t", "f"); // opDispatch
assert(results[0] == "fesf");
assert(results[1] == 2); // two instances of 't' replaced

Note: To call a member named "object", instantiate this function template explicitly.

Meta