lua-users home
lua-l archive

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


This is nice. I will guess that it is much faster than my lua-only
version, and it doesn't require the debug library.

When I take another pass at this, I might explore putting some
portions into C. However, I haven't done any benchmarking and I
haven't noticed any slowdown... yet. :)

Thank you for this example!

-Andrew

On Tue, Aug 13, 2013 at 12:08 PM, Thijs Schreijer
<thijs@thijsschreijer.nl> wrote:
>> -----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
>
>