[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Forward function declarations - relocal command
- From: Kevin Martin <kev82@...>
- Date: Wed, 21 Nov 2012 19:10:08 +0000
Replace relocal by local in both examples, in first example will print nil, not 1. Second example identical.
Sent from my iPhone
On 21 Nov 2012, at 18:53, Wesley Smith <wesley.hoke@gmail.com> wrote:
>> local f = 2
>> do
>> relocal f
>> print(f) --prints nil as the relocal creates a new local variable, masking the outer f, because there is no f in this scope level
>> end
>
> Isn't this is what local already does or am I missing something about relocal.
>