lua-users home
lua-l archive

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

>Until Lua becomes Sol or Sol becomes Lua

I don't think this is going to happen. :-)

>Already with that start I think a problem exists.  To code readable modules
>(that is, without making a rats nest of upvalues) the module's table needs
>to be a global.  To make a global you have to pick a name, and therefore
>will have name clash problems. 

Lua 4.0 introduced the REGISTRY, which can be used to avoid clashes.
Or, at least, to have a way to know whether someone already has taken the name
you want.

The registry is an ordinary Lua table that is available only to C (you get it
on the stack by lua_getregistry(L)). It is mainly used in libraries now,
but we hope it has others uses, and helps to create disciplines.
It's up to you to find how to do that...