lua-users home
lua-l archive

Re: lua source as config file

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


That's not imaginary. Your configuration file just
returns
the table:
return {
	config = "var";
};
thanks.
thought about that too but the return makes it look
less like a config file.
Oh, I forgot to mention, my dofile approach is also a
bit dangerous too.
What i usually do is something like:
---------
function read_settings(filename)
	local f=loadfile(filename)
	local t={}
	
	setfenv(f,t)
	f()
	return t
end
local settings=read_settings(filename)
--------
--
----------------------------------------------------------
Mikko Sivulainen
Senior Programmer
Bugbear Entertainment Ltd.
e-mail: mikko.sivulainen@bugbear.fi
phone: +358-40-5272342

AltStyle によって変換されたページ (->オリジナル) /