On Jun 21, 2006, at 22:18 UTC, Mike Woodworth wrote: > well, this seems to kinda work as is... except for the parts that > don't work at all :) my early tests with simple things like beep > seemed fine, but now that im doing stuff that relies on instance > properties in the callback - it appears i'm not really in the > instance at callback time??
Of course you're not. How would whatever's calling this callback method know to pass in the magic parameter that gets mapped to 'self'? That's the whole point about instance methods, and why Mars said that you couldn't do anything useful with them -- an instance method, in any language, involves passing along some extra information that identifies the instance. There is no way for you to know (because it's not documented) what form this information takes, so there is certainly no reliable way for whatever's invoking the callback to know that and do it properly. > it appears that the callback is calling the instance method as if it > were a shared method? It's calling it as if it is a function pointer, since that's all it is. It doesn't know anything more about it. Play around with invoking instance methods that way, without the extra info they need, and I would expect your app to crash. Kinda neat to hear that maybe it doesn't in your case, but I certainly wouldn't rely on that. > do all class instances share the same function ptr? > then some magic is done to ref the right properties at call time? Yes, the magic is in the extra info which gets passed in any proper call to an instance method. Best, - Joe -- Joe Strout -- [EMAIL PROTECTED] Verified Express, LLC "Making the Internet a Better Place" http://www.verex.com/ _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html>
