[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: local scope once again
- From: "Leo Razoumov" <slonik.az@...>
- Date: Tue, 12 Dec 2006 19:04:26 -0500
On 12/12/06, Russ Cox <rsc@swtch.com> wrote:
> This behaviour means that all earlier local declarations of the
> variable become completely shadowed by later local declarations at the
> same scope. I am afraid it makes code less readable.
>
> local x="first declaration"
> local x="second declaration" -- the same scope
Then don't write code like that. Problem solved.
Russ
I chose a minimalistic example for illustration purposes only. Please,
refer to Asko Kauppi's message earlier in this thread for a realistic
code example which causes a run-time error (calling nil as a
function)
--Leo--