[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: namespace blues
- From: Dirk Laurie <dirk.laurie@...>
- Date: Fri, 17 Apr 2015 11:49:13 +0200
2015-04-17 11:16 GMT+02:00 <klaas.decanniere@telenet.be>:
> local z={}
> z.z = {}
>
> does not work
>
> stdin:1: attempt to index global 'z' (a nil value)
> stack traceback:
> stdin:1: in main chunk
> [C]: ?
>
> What is happening?
In an interactive Lua session, local variables are local to
the line of code unless they are in an unclosed block.
I.e.
local z={}; z.z = {}
should work.