Re: Solved. Re: Fwd: Inspecting objects

Nigel Atkinson <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <1269035797.1342.20.camel@maxdevwl>
On Fri, 2010-03-19 at 11:11 -0700, Thomas Nelson wrote:
> Solved... My bad.  It turns out it had to do with how I was exporting 
> the object... turns out it's helpful to wait till after you've created 
> the instance before you inject a back ref.

Glad you got it sorted!

> 
> Any interest on the list for a patch with the following enhancements:
> 1) Export a luabind::wrap_base derived object to an arbitrary 
> table/namespace in the lua from C++
> 2) Allow methods to be overridden on a per instance basis

I thought you could already do this?

> 3) Examine an object from C++ to determine if a method has been defined 
> on an instance.

I'd interested to see how you have done it...  at the moment I use a Lua
function to do that job, which I call from C++.

> 
> todos
> 1) When exporting via item 1, allow the programmer to specify a lua class.
> Right now you can only specify a C++ class that has been exported via 
> luabind.  I want to be able to export as a class that has been derived 
> on the lua side.
> 
> 2) There are some problems with the function over rides that seem to be 
> based pretty deeply in how lua handles method calls with a self.
> so defining:
> 
> function MainMenu:OnMenu(args)
> 
>      print("boo");
> 
> end
> 
> works, however
> 
> function foo(self, args)
> 
>      print ("ack");
> 
> end
> MainMenu.OnMenu = foo;
> 
> breaks.

That's weird... it should work!

What about

function MainMenu.OnMenu( self, args )

	print( "ack" )

end

I'd be very surprised if that does not work.


Nigel


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.