lua-users home
lua-l archive

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


variable is just a label to a memory address.


see more below:

https://en.wikipedia.org/wiki/Immutable_object
http://lua-users.org/wiki/ImmutableObjects

Immutability of strings

Lua strings are immutable and interned. This has some implications [4]. To create a string that differs in only one-character from an existing 100 MB string requires creating an entirely new 100 MB string since the original string cannot be modified.






---- Em Qua, 25 mai 2022 11:45:41 -0300 Duke Normandin <dukeofpurl@gmx.com> escreveu ----

Lua noob here! Reading Lua primer at learnxinyminures.com to start
off with.
It says that Lua variables are immutable like in Python. However,
in the Lua REPL, I can change any value I set. Maybe I should be
reading a more recent tutorial? TIA ...
--
Duke
** Text only please. Bottom post works best for me **