[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: local by default?
- From: Russ Webb <Russell.Webb@...>
- Date: Mon, 29 Apr 2002 13:06:02 -0700
>> Personally, I like declaring all locals since it prevents typos from
>> creating side-effects,
> How so?
The rest of my intended statement was... AND, declaring global writes.
function foo()
local bat -- oops, typo
bar = 10 -- this is a undeclared global write -> error
return bar
end
function foo()
local bar
bat = 10 -- oops, typo -- this is a undeclared global write -> error
return bar
end
Russ