[oolua] Re: Getting class info from instance in Lua

  • From: Sean Dunn <seanedunn@xxxxxxxxx>
  • To: "oolua@xxxxxxxxxxxxx" <oolua@xxxxxxxxxxxxx>
  • Date: Sun, 2 Mar 2014 09:50:50 -0600

I think we're on the same page. Since Lua isn't a strongly typed language, it's 
useful to know what you're sending to an OOLua proxy. It seems like a good 
design decision of yours not to use RTTI in Oolua, but I need a basic way to, 
from Lua, to do the following:

local inst
-- some code, we don't know what inst is, but it's possibly from MyClass.new()
if MyClass.isInstance(inst) then
    -- do something
end

Do you have any ideas on how I could achieve this using OOLua, or is this 
something I could only do by changing the library to store some intrusive data 
as part of the instance (for example, via a mix-in)?

> On Mar 2, 2014, at 6:55 AM, "Liam Devine" <liamdevine@xxxxxxxxx> wrote:
> 
>> On 02/03/14 05:17, Sean Dunn wrote:
>> I'm trying to determine whether an instance is a member of a specific proxy 
>> class, in Lua. I've looked through the documentation, and I don't see any 
>> mention of what the API is on the Lua side, or whether this is possible. Can 
>> someone point me to docs, or where in the source this is specified?
>> 
>> Thanks,
>> Sean
>> 
>> --
> Sean,
> 
> If I understand you correctly, the library does not store any
> information about members of a class.
> 
> -- 
> Liam
> 

Other related posts: