On Fri, 29 Mar 2002, Lyle Johnson wrote: > > One final thought. I'm a little confused as to why you would > > want to wrap a C++ class, when Ruby already supports classes. Wouldn't > > it make more sense to declare the class in Ruby, and have each Ruby > > method do its work by calling a regular C routine? > > SWIG's Ruby module looks at a C++ class declaration and generates wrapper > code to: > > * define the class > * define all of the class instance methods (and singleton methods, as > appropriate) > * convert input arguments from their Ruby types (e.g. strings, fixnums, > floats) to the appropriate C++ types; > * call the C++ member function on the correct C++ instance > * convert the return value of that call from its C++ type to the appropriate > Ruby type > > This is just the bare minimum of what SWIG does. A lot more is possible... > Wow! That's pretty cool. Please excuse my ignorance. Now it makes alot of sense. Thanks again for the info. Dennis