lua-users home
lua-l archive

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


(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

})()