Reputation:
From an in-app server, I receive a table and inside this table there's a key marked as userdata
. I red this type is there to allow arbitrary C data to be stored inside Lua variables. Is it possible to read/access its content from Lua?
Upvotes: 0
Views: 72
Reputation: 5847
Lua can't read data from userdata, unless you write native functions that will read and return bytes from userdata in some way you will find convenient - as array of numbers, as string, or maybe just returning single byte at specified index.
Maybe your host app/framework already has these functions, but Lua itself definitely can't do that.
Corona SDK's page for userdata only quotes Lua's doc, telling basically the same - there's no operations on userdata in Lua, except assignment and identity test.
Upvotes: 2