lua-users home
lua-l archive

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

> And I'd be slightly shocked if it didn't already do the pointer comparison before jumping into byte comparisons.
In this case pointers will never be equal and and it will always jump
into byte comparisons.

> You can do this already, except for the check for uniqueness:
> #define lua_loadstrconst(L,s) s=lua_pushstring(L,s)
> You also need to ensure that the strings do not get garbage collected,
> e.g., save them in the registry or some other global table.

Cool, that's even better. I didn't notice that since it is Lua 5.2 feature.