[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Interfacing lua with C
- From: Juergen Fuhrmann <fuhrmann@...>
- Date: Fri, 17 Jan 2003 10:05:37 +0100 (MET)
> Thu, 16 Jan 2003 09:12:55 -0200
> Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
>
> >But still...can I get around the newindex problem to be able to assign
> >values to my C vars more than once?If not all else is useless.
>
> One way is to use a proxy table that is always empty and set __index/__newindex
> metamethods to read/write from your table or C. Something like this:
>
> C={} -- proxy for C vars
>
> setmetatable{C,{
> __index = function (t,i) get and return C var i end
> __newindex = function (t,i,v) set C var i to v end
> })
>
> The same idea works for implementing the old gettable/settable tag methods.
> --lhf
Hi,
in Lua 4, tolua <http://www.tecgraf.puc-rio.br/~celes/tolua/> is quite
satisfactory for me. I am not sure if and when it will be ported to
lua 5.
I think, a tolua implementation which is maintained basically in
parallel to Lua could save the Lua author time answering questions
within this\ respect (at least from my side).
Juergen