pcall

Calls a LuaFunc or LuaFuncWeak in protected mode, which means an exception is thrown if the function produces a LUA error.

Notes: As with all functions that return a LuaValue, strings are copied onto the GC heap so are safe to copy around.

As with all functions that return a LuaValue, the "weak" variants of data types are never returned.

Calling this function on a LuaFuncWeak will permanently pop the function off the stack. This is because weak references don't have the ability to push their values.

  1. LuaValue[results] pcall(LuaFuncT func, Args args)
    template pcall(size_t results)
    static if(results > 0)
    LuaValue[results]
    pcall
    (
    LuaFuncT
    Args...
    )
    (
    LuaFuncT func
    ,
    Args args
    )
  2. void pcall(LuaFuncT func, Args args)

Members

Functions

pcall
LuaValue[results] pcall(LuaFuncT func, Args args)
Undocumented in source. Be warned that the author may not have intended to support it.
pcall
void pcall(LuaFuncT func, Args args)
Undocumented in source. Be warned that the author may not have intended to support it.

Parameters

results

The maximum number of results expected to be returned by the function. Any values that are not provided by the function are instead set to LuaValue(LuaNil())

Return Value

A static array of LuaValues representing the values returned by the LUA function.

Meta