[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Numerical constants
- From: Philippe Lhoste <PhiLho@...>
- Date: Thu, 24 May 2007 13:30:27 +0200
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...
-- (near) Paris -- France
-- -- -- -- -- -- -- -- -- -- -- -- -- --