Behaves like lua_gettable, but prevents
unrecoverable program crashes by calling that function through
. Takes an additional status code pointer
that is set to the status returned by Lua.lua_pcalllua_pcall.
Modulelua-2.3.2Haskell2010
Lua.Ersatz
Ersatz functions for Lua API items which may, directly or indirectly, throw a Lua error.
- 10 values
- Packagelua-2.3.2
- Exports10
- LanguageHaskell2010
- LicenceMIT
- SourceErsatz.hs
Get functions (Lua -> stack)
2 declarationsBehaves like lua_getglobal, but prevents
unrecoverable program crashes by calling that function through
. Takes an additional status code pointer
that is set to the status returned by Lua.lua_pcalllua_pcall.
Set functions (stack -> Lua)
2 declarationsBehaves like lua_settable, but prevents
unrecoverable program crashes by calling that function through
. Takes an additional status code pointer
that is set to the status returned by Lua.lua_pcalllua_pcall.
Behaves like lua_setglobal, but prevents
unrecoverable program crashes by calling that function through
. Takes an additional status code pointer
that is set to the status returned by Lua.lua_pcalllua_pcall.
Misc
4 declarationsReplacement for lua_error; it uses the HsLua error signaling convention instead of raw Lua errors.
Wrapper around lua_next which catches any Lua errors.
Wrapper around lua_concat which catches any Lua errors.
hslua_compare :: State-> StackIndexindex 1
-> StackIndexindex 2
-> OPCodeoperator
-> Ptr StatusCodestatus
-> IO LuaBool
Compares two Lua values. Returns 1 if the value at index index1
satisfies op when compared with the value at index index2,
following the semantics of the corresponding Lua operator (that is,
it may call metamethods). Otherwise returns 0. Also returns 0 if
any of the indices is not valid.
The value of op must be one of the following constants:
LUA_OPEQ: compares for equality (==)
LUA_OPLT: compares for less than (<)
LUA_OPLE: compares for less or equal (<=)
This function wraps lua_compare and takes an additional parameter
status; if it is not NULL, then the return value is set to the
status after calling lua_compare.
Auxiliary Library
2 declarationsCreates a new Lua state and set extra registry values for error bookkeeping.
Converts object to string, respecting any metamethods; returns
NULL if an error occurs.