From: Kevin S. <kev...@ho...> - 2001-08-18 03:33:12
|
On Sat, 18 Aug 2001, Takaaki Tateishi wrote: > the method `func_a' of the class RA is used since there is no > such method in the RB. so the function `rb_a_func_a()' is called. > the value of `self' represent the `b'. we can obtain the `data' as > the object instantiated from the class A using Data_Get_Struct(), > but `data' is the object instantiated from the class B. something > like the cast is done here. > > of course, this is depend on the implementation. the advantage is > that we don't need to implement all methods for each subclass. Ok. I understand this perfectly now. > - we'd like to avoid the multiple inheritance. Yes. > - it is not recommended that ruby object is owned by the `RBFLXxxx'. I still don't understand this. If you write a C program that links with the ruby library, then C code will own all the ruby objects. Is there a difference with C++ here? > - (I don't want to write all methods for each class.) I agree, but we can automate this using macros, templates, or our own preprocessor (something like SWIG, I guess). By the way, did you consider SWIG? Have you tried it on any projects? I haven't, and I'm still trying to figure out if it would help us or not. Hashes would be ok, too, if we keep it simple. I'll think about that angle. I think simplicity is one of the most important attributes of any project. > but I want to think about this issue for a few days, since I > think that it is the most important point of Ruby/Fltk. > and I will try to find another design improving your idea. Great. I'll be experimenting this weekend, which will really help me understand how to improve my ideas, too. Kevin |