lua-users home
lua-l archive

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


On 17 February 2010 17:37, Kelley, Brian <bkelley@qualcomm.com> wrote:
> On Feb 17, 2010, at 4:27 AM, Alex Davies wrote:
>> The only problem is there is no clear and obvious way the code should
>> function, so my stance has always been throw a meaningful error.  It's not a
>> hard one to catch at all, requiring only a minor modification to the
>> parser..
>
> Why is it not clear and obvious that a newly-created variable's value will be nil unless it has been assigned some other value?
>
> People can use 'if' to skip assignments, also.  I don't hear people worrying needlessly about that, or clamoring for the compiler to emit warnings in those cases.
>

Forgive me if I'm wrong but nowhere is it possible in the current Lua
to skip a "local" declaration and still be able to access the local
variable that that statement declared.

Matthew