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:

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 <> escreveu ----

Lua noob here! Reading Lua primer at 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 ...
** Text only please. Bottom post works best for me **