lua-users home
lua-l archive

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


Doug Rogers wrote:

> luaL_newmetatable( vm, "Event.mt");
> ...
>   luaL_getmetatable(L, "Event.mt");   // setmetatable(obj, mt)

As an aside, I prefer not to use '.' in my metatable names because I
find it confusing. I usually use "object_mt", such as "bstring_mt".

Since the name will only appear in the registry it can never be
retrieved from Lua code, so there's not much danger in its being
misunderstood by Lua end users. For experienced Lua C API programmers
the '.' is like a huge beacon that says "NOTICE ME! I'm not a normal
table entry!" I see that as a moderate benefit.

I still prefer not to use it.

Doug

-- 
Innovative Concepts, Inc. www.innocon.com 703-893-2007 x220