hello everyone:
i am a beginner of lua. last day i've read a article which mentions that "First, all strings in Lua are internalized;
this means that Lua keeps a single copy of any string. Whenever a new string
appears, Lua checks whether it already has a copy of that string and, if so,
reuses that copy."
[http://www.lua.org/gems/](here is the book).
So yep i just wanna know if i define like this:
>s1 = "hello"
>s2 = "hello"
do s1 and s2 use the same copy? I try to see the address of the two string in the memory, but i don't know how to do it?
(i don't speak english, so excuse me for my poor english,:))
thank you everybody!
i am a beginner of lua. last day i've read a article which mentions that "First, all strings in Lua are internalized;
this means that Lua keeps a single copy of any string. Whenever a new string
appears, Lua checks whether it already has a copy of that string and, if so,
reuses that copy."
[http://www.lua.org/gems/](here is the book).
So yep i just wanna know if i define like this:
>s1 = "hello"
>s2 = "hello"
do s1 and s2 use the same copy? I try to see the address of the two string in the memory, but i don't know how to do it?
(i don't speak english, so excuse me for my poor english,:))
thank you everybody!