[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Local and Global Variables
- From: Sean Conner <sean@...>
- Date: Sat, 27 Apr 2013 02:20:05 -0400
It was thus said that the Great Dirk Laurie once stated:
>
> Is anybody regularly using the following idiom for temporarily grabbing
> 200 slots for the price of one?
>
> (function ()
> -- code goes here
> end)()
I do the following:
do
-- code goes here
end
for locals that I know I don't want hanging around. Usually, it's for stuff
like:
local data
do
local f = io.open("datafile","r")
data = f:read("*a")
f:close() -- don't really need this, but I like being explicit
end
-- code that uses data
-spc