[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua AST and Parsing a "C" Like language
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 22 Aug 2011 11:21:45 +0200
On Mon, Aug 22, 2011 at 11:08 AM, Axel Kittenberger <axkibe@gmail.com> wrote:
> Also you might consider just your "DDL" to be simple valid Lua code.
> Lua call syntax and so allows you to create an environment with custom
> function that very much doesn't need to look like lua.
For instance, this is valid Lua:
device "norba" {
dev = 'ttyS2',
baudrates = {19200,115200},
IRQ = 4
}
It works because device can be defined as a function that takes a
string, and returns a function that receives a table - the call syntax
sugar makes this readable. (device() is a nice example of a useful
'curried' function in Lua)
steve d.