lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 11 June 2011 07:26, zhiguo zhao <> wrote:
> cdata create with
> getmetatable(cdata) return string 'ffi', why not a table
> when use ffi, we need to handle getmetatable not return table.

That can technically happen in plain Lua already:

    local a = setmetatable({}, { __metatable = "string" });

Although I've never seen a string used before, boolean 'false' is
often used just to hide/protect a metatable.