lua-users home
lua-l archive

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



How does that work, if the strings are literals, not LUA vars ?

s = "TAG1"
if s=="TAG1" then ... end
<some code>
if s=="TAG1" then ... end

unless the lua compiler builds a stringtable of literals, it cannot know
that the three "TAG1" literals are the same, eg have identical pointers.

Lua does build the string table. The 3 occurances of "TAG1" above all get mapped to the same entry.

Ashwin.
--
no signature is a signature.