lua-users home
lua-l archive

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

On Feb 02, 2005, at 23:56, Luiz Henrique de Figueiredo wrote:

Everytime you call lua_pushstring() a new string is pushed onto the stack.

Only true if the string is new to Lua.

I thought that string interning was an implementation detail not really to be relied upon. Are you going to guarantee that if I pushstring the same character sequence I get identical pointers when I tostring them?

lua_pushstring(l, "hello");
lua_pushstring(l, "hello");
p = lua_tostring(l, -1);
q = lua_tostring(l, -2);
c = (p == q);

So you guarantee that c=1 ?

David Jones