Re: lua source as config file
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: lua source as config file
- From: Mikko Sivulainen <mikko.sivulainen@...>
- Date: 2007年2月08日 10:56:46 +0200
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