[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Top level is a chunk
- From: Matthew Wild <mwild1@...>
- Date: Mon, 31 Oct 2011 23:27:07 +0000
(function () {
On 31 October 2011 22:59, Gavin Wraith <gavin@wra1th.plus.com> wrote:
> It had somehow never hit home to me that the top level of a Lua program
> is a chunk. Because of this I had been enclosing my programs within
> do ... end structures so that I could use local variables at the top level
> I expect all this is not news to seasoned Lua users, but I thought the
> disassembly listings might entertain.
I still remember the moment I realised (with a groan) that "var foo =
true" in the top level of a Javascript script had visibility
throughout the current environment. Sigh.
Regards,
Matthew
})()