lua-users home
lua-l archive

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


> -----Original Message-----
> From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org] On
> Behalf Of Andrew Starks
> Sent: dinsdag 13 augustus 2013 0:35
> To: Lua mailing list
> Subject: Re: [ANN] Weak Type: A type library for the weak (hack stage)
> 
> On Mon, Aug 12, 2013 at 10:57 AM, Philipp Janda <siffiejoe@gmx.net> wrote:
> > No need for the C API if you have the debug module available:
> >
> >     > print( debug.getregistry()["FILE*"], debug.getmetatable( io.stdin
> ) )
> >     table: 0x7446d0     table: 0x7446d0
> 
> Hmm... that seems like a useful hack, until I want to do it the "right"
> way...
> 
> -- Andrew

Here's a sample I wrote for my library template; https://github.com/Tieske/Lua_library_template/tree/master/udtype_example 

It returns the metatable name as a second argument, and creates a proxy table for quicker retrieval afterwards

Thijs