[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua as configuration language
- From: Marc Balmer <marc@...>
- Date: Sat, 5 Jan 2013 00:06:18 +0100
Good idea. How would the Section function look like?
> Marc Balmer wrote:
>> I posted a short article on how to use Lua as a configuration and data exchange language.
>>
>> Comments welcome.
>>
>> http://www.netbsd.org/~mbalmer/lua/lua_config.pdf
>
> It's worth adding an explanation of multiline comments and strings.
>
> It's also possible to implement something like this:
>
> Iface "lo0" {
> ip="127.0.0.1",
> mask="255.0.0.0"
> }
>
> and build a framework to register sections and define validation
> rules. For instance:
>
> local Iface = Section { ip="string", mask="string" }
>
> The simplest version of Iface is below.
>
> function Iface(name)
> return
> function(content)
> _G[name] = content
> end
> end
>
> Alex
>