lua-users home
lua-l archive

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



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/