I think I saw somewhere a native function in Lua that can return a new userdata. Does it exist? Is it possible to create custom userdata from normal Lua script?
相关问题
- How to get the return code of a shell script in lu
- Accessing Light userdata in Lua
- Wireshark dissector that works with tls/ssl
- Email address validation using corona sdk
- Using a coordinate pair as a key in a Lua table
相关文章
- Lua Integer type
- First character uppercase Lua
- torch / lua: retrieving n-best subset from Tensor
- How to handle errors when resuming a Lua thread (c
- Is Lua an object-oriented language?
- Getting previous day's date in Lua
- How do I create a save game feature in love2d?
- What is the best way for debug output for the lua
You may be thinking of
newproxy
From: http://lua-users.org/wiki/HiddenFeatures
It was also useful for
__gc
metamethods, as a hack to get a callback when thenewproxy
instance becomes free.This feature was present in Lua 5.1, but removed in 5.2. In Lua 5.2,
__gc
metamethods can be set on zero sized tables, so the main impetus fornewproxy
went away.Actually no, in pure Lua.
link
If you embed luaVM in host C/C++ application, you can export some function to create userdata to Lua, but it's not a good practice. UD is designed to be a blackbox for Lua scripts.