lua-users home
lua-l archive

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


> I hate to bring this subject back up after it sparked so much debate in the
> past, but I wonder if this limit could be increased to, say, 64 or 128
> bytes? In my C libraries' __index and __newindex methods I avoid doing a
> lot of strcmp()s to compare the key to each valid field name, by storing
> all valid field names in a table in the registry. String interning means
> that instead of using strcmp() to check the key I can just use a standard
> equality test. But that will fail if I have a field with a more than
> 40-character name (not unimaginable) and Lua doesn't intern the string,
> meaning the pointer I get as my key isn't the same as the string I stored
> in the registry.

For me, a field name with 40 characters is as unimaginable as one
with 64.  (Once you lose your mind, there is no limit on what you can
think... :)

-- Roberto