lua-users home
lua-l archive

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


On 24/05/2007 10:51, Thomas Lauer wrote:
I would like to know what others have done when faced with long lists of
constants. (A quick search in the archives has brought no revelation.)

Things I consider are first and foremost ease of use (for the clients of
the library, not for me;-) and efficiency, space- and time-wise.

I never looked closely at its implementation, but I recall that in Lua integration to SciTE, author avoided to put all the constants in the Lua variable space, bloating the memory use.

Instead, all constants from the Scintilla component are defined as global variables, and using the __index metamethod on _G, he retrieves the constant on demand.

I hope this makes sense...

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --