lua-users home
lua-l archive

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


  Much better, thank you.  Implementation in C would be slightly cleaner if
a metatable could be attached to lightuserdata (avoiding pointers to
pointers and having to allocate extra memory), but that's no biggie.  Works
great!

  Dan East

-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br]On Behalf Of Luiz Henrique
de Figueiredo
Sent: Monday, June 14, 2004 12:30 PM
To: lua@bazar2.conectiva.com.br
Subject: RE: __assign


>I'm currently storing the pointer to the C struct as the only element
>in the table.

If you're storing everything in C, you don't need to create a proxy Lua
table:
just export the C struct as userdata to Lua and set __index and __newindex
metamethods for it.
--lhf