[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua type names and the __type metafield
- From: Michal Kottman <k0mpjut0r@...>
- Date: Mon, 8 Oct 2012 11:45:05 +0200
On 8 October 2012 00:40, Rob Hoelz <rob@hoelz.ro> wrote:
> Typical is *really* simple; on Lua values without a metatable, it just
> calls _G.type. If the value has a metatable, it checks for a __type
> field in the metatable and uses that if found.
This is actually very nice. It will already work for lqt, because
every type metatable has a __type field, so for example:
o = QObject()
print(o.__type) --> QObject*