[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Improvements for creating DSL with Lua
- From: Petite Abeille <petite.abeille@...>
- Date: Sun, 16 Aug 2009 20:18:43 +0200
On Aug 16, 2009, at 8:06 PM, Alexander Gladysh wrote:
I usually use this idiom in my DSLs:
has "x" { is = 'rw', isa = 'number', default = 0 }
Furthermore, one could avoid all those confusing quotes around
strings, e.g.:
Is( Author )
Has( name )
HasMany( publishers )
HasMany( books )
The literals ( Author, name, publishers, books ) can be resolved
properly at runtime given a proper environment:
http://dev.alt.textdrive.com/browser/DB/TestModel.lua
http://dev.alt.textdrive.com/browser/DB/DBModelStatement.lua
http://dev.alt.textdrive.com/browser/DB/DBSQLStatement.lua
That said... not sure if this is really worth the bother... YMMV...
Cheers,
--
PA.
http://alt.textdrive.com/nanoki/