Creates a new userdata wrapping the given Haskell object. The userdata is pushed to the top of the stack.
Modulehslua-core-2.3.2Haskell2010
HsLua.Core.Userdata
Convenience functions to convert Haskell values into Lua userdata.
- 4 values
- Packagehslua-core-2.3.2
- Exports4
- LanguageHaskell2010
- LicenceMIT
- SourceUserdata.hs
Creates and registers a new metatable for a userdata-wrapped Haskell value; checks whether a metatable of that name has been registered yet and uses the registered table if possible.
Returns True if a new metatable was created, and False otherwise.
Using a metatable created by this functions ensures that the pointer to the Haskell value will be freed when the userdata object is garbage collected in Lua.
The name may not contain a nul character.
fromuserdata :: StackIndexstack index of userdata
-> Nameexpected name of userdata object
-> LuaE e (Maybe a)
Retrieves a Haskell object from userdata at the given index. The userdata must have the given name.