lua-users home
lua-l archive

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


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