[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Implicit Globals - A (better?) compile time solution.
- From: "Greg Falcon" <veloso@...>
- Date: Tue, 26 Feb 2008 11:09:14 -0500
On 2/26/08, John Hind <john.hind@zen.co.uk> wrote:
> 1. Implicit variables should be made local, with function scope to the
> inner-most function or chunk (*not* block) enclosing the first assignment
> (write).
You are converging on the Python implicit-local rules. I think there
are a handful of reasons why the Python rules are unsuitable for Lua,
the main one being that they seem to require a multi-pass compiler to
implement. (You have to read through an entire function before you
know which names refer to implicit function-scope locals; this matters
when generating bytecode for variable reads.)
Greg F