lua-users home
lua-l archive

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

>function NewMonster(name, health)
> local tbl = {}
> = name;
> = health;
>The problem is how to (fast and easy) keep in the same data (struct) 
>in Lua and in C.

In Lua 4.0, set gettable/settable tag mehtods for tbl to do this.
In Lua 5.0, you'll have to use proxy tables if you insist on have the data
stored both in Lua and in C.