LuaD



struct  LuaDynamic;

Represents a reference to a Lua value of any type. Supports all operations you can perform on values in Lua.


LuaObject  object;

Underlying Lua reference. LuaDynamic does not sub-type LuaObject - qualify access to this reference explicitly.


LuaDynamic[]  opDispatch(string name, string file = __FILE__, uint line = __LINE__, Args...)(Args args);

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.

Parameters
name name of method
Args args additional arguments
Returns
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.

LuaDynamic[]  opCall(Args...)(Args args);

Call this object. This object must either be a function, or have a metatable providing the __call metamethod.

Parameters
Args args arguments for the call
Returns
Array of return values, or a null array if there were no return values

LuaDynamic  opIndex(T)(auto ref T key);

Index this object. This object must either be a table, or have a metatable providing the __index metamethod.

Parameters
T key key to lookup

bool  opEquals(T)(auto ref T other);

Compare the referenced object to another value with Lua's equality semantics. If the other value is not a Lua reference wrapper, it will go through the regular D to Lua conversion process first. To check for nil, compare against the special constant "nil".