[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: local by default?
- From: Eric Tetz <erictetz@...>
- Date: Mon, 29 Apr 2002 12:54:06 -0700 (PDT)
--- Russ Webb <Russell.Webb@corp.palm.com> wrote:
> Personally, I like declaring all locals since it prevents typos from
> creating side-effects,
How so?
function foo()
local bat -- oops, typo
bar = 10
return bar
end
function foo()
local bar
bat = 10 -- oops, typo
return bar
end
In either case you've just created a new global, or worse, you've just changed the value of an
existing global. Right?
__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com