From: Lyle Johnson Date: 2002-02-13T00:51:52+09:00 Subject: Re: Proposed Modification for SWIG/Ruby > What happens if you change this line to: > super() > > > @x, @y = x, y > > end > > end > > > > d = Derived.new(2.0, 3.0) No joy; the argument list for Derived#initialize is not the problem. The inconsistency is in the fact that we're calling Base.new with two arguments when it's expecting zero arguments. Part of my proposed change for SWIG would involve rewriting Base.new so that it doesn't make any assumptions about how many arguments will be passed to it; it just allocates memory for the object and then passes off the entire argument list to the object's initialize method. When I was scratching around for some information on this topic I found a nice post from Dave that describes what's going on under the hood: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/4707 You can also see examples of this in many Ruby extensions, especially those in the standard Ruby sources (e.g. ext/dbm/dbm.c). Hope this helps, Lyle