lua-users home
lua-l archive

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




On Fri, Jun 7, 2019 at 3:02 PM szbnwer@gmail.com <szbnwer@gmail.com> wrote:
hi there! :)

Egor & Coda:
i think `local <static> y = y or {x}` would/should/could(?) keep
`{x}`, as i would interpret it as `y` will be there in the next call
from the previous one, otherwise, as it is, its always overwrite `y`,
that contains the stuff from the previous round (in my
interpretation...)

(ps.: sry for the poor linkage to the history of the messages, but i
use the dummy variant of gmail, where i can only top post, throw away
the original, or copy-paste whatever, and i also only have the last
msg, so i dont even know if i should name anyone else around this sub-
and/or offtopic... and im also too lazy and busy to invest more
efforts :D )

bests! :)

That doesn't quite work. As it stands, this statement:

local x = x

creates a new local variable named x containing the value of the global variable named x. Unlike in C, the _expression_ is evaluated BEFORE the new identifier is added to the scope.

/s/ Adam