lua-users home
lua-l archive

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


2006/3/28, Sebastian Rohde <rohde@bluebyte.de>:
> > While working on our lua_State serialization I found that lua tables seem
> > to have a metatable even if it seems that none has been set by the user or
> > by our code. Is that correct?
> > Can this metatable be safely ignored and how can I distinguish this
> > metatable from user defined to ignore it during serialization? (And why
> > did this metatable not have this standard metatable?)

I'm not sure why your tables have a metatable. Here's what I get with
Lua 5.1 final:

    Lua 5.1  Copyright (C) 1994-2006 Lua.org, PUC-Rio
    > print(getmetatable({}))
    nil
    > print(debug.getmetatable({}))
    nil

So your tables must be getting their metatable from somewhere in your
code... Have you tried looking at the content of those metatables ?

--
Julien Cugnière