lua-users home
lua-l archive

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


On Mon, Apr 27, 2009 at 5:47 PM, TNHarris <telliamed@whoopdedo.org> wrote:
> This patch makes Lua symbols and table keys case-insensitive. Constant
> tables and the string pool are kept case-sensitive. And a function is
> exported to toggle the case-sensitive flag on select tables (but only
> prior to inserting elements). I'm using two of the extra bits in
> Table.flags: bit 7 is set when the table ignores case, bit 8 is set when
> the table has not been modified. TString gets an extra unsigned int for
> the folded hash.
>
> It makes Lua, an already simple an unintimidating language, even simpler
> and less intimidating for people who are used to using things such as
> Basic. Because it's far easier to modify Lua than it is the end users.
>
> Actually, I just wanted to see if it could be done and learn the
> internals along the way.

I can maybe see doing this for Lua symbols but why tables? You can
simply use a metatable to allow this.

-- 
-Patrick Donnelly

"One of the lessons of history is that nothing is often a good thing
to do and always a clever thing to say."

-Will Durant