lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Feb 08, 2007 at 12:22:50AM -0800, gary ng wrote:
> I am sure this must have come up before but failed to
> search it through google etc.
> 
> at the moment, my relatively ugly solution is just
> this :
> 
> dofile("my_config.lua")
> 
> where my_config.lua is like this :
> 
> my_config={ ... all sorts of embedded table ...}
> 
> This however pollute the namespace. What I want is to
> do something like this(imaginary):
> 
> in my program:
> 
> local my_config=dofile("my_config.lua")
> 
> where the same table is created but not polluting the
> name space.

That's not imaginary.  Your configuration file just returns
the table:

return {
	config = "var";
};

-- 
Glenn Maynard