On Wed, 16 Apr 2003 18:28:03 +0000, Steve Hart wrote:
> 
> You see, I load ruby scripts from a 'menu' of ruby scripts in c++/Qt.
> These scripts may share ObjNode's (hence the need to check if the obj
> exists in createObjNode)

This is called lazy behaiver, only doing stuff when its really needed.
This makes things "hard" for us comp.lang.ruby fellows to graps.
Maybe you should start out with a more naive scheme ??

A good principle:
1  make it work
2  make it fast
3  make it safe

This lazy behavier pattern is belonging to (2).
http://www.wikipedia.org/wiki/Lazy_evaluation


> SWIG uses the Data_Wrap_Struct to handle ruby<=>cpp.I can use the mark
> and free functions to handle obj->v but what about obj and what about
> tObj?. Should I use rb_gc_register_address to let GC it's busy and
> then use rb_gc_unregister_address
> to free them off when the stack is cleared as I indicate above. 

I need to know more about your "idea". Thus im not getting this and
therefore im unable to answer this :-)


> It would be great if this were tha case cause I've written most of 
> the code and it 'seems' to work - so far! I'm still debugging :-)
> Or, perhaps there is a neater way of doing this?.

Can you show us a UML "class diagram" of your idea ???
Then we provide you with much better help.


--
Simon Strandgaard