[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Best way to share "structs" between C and Lua
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 16 Jan 2003 12:02:24 -0200
>function NewMonster(name, health)
>
> local tbl = {}
> tbl.name = name;
> tbl.health = 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.
--lhf