On Fri, 22 Nov 2002 00:06:36 +0900, 
christopher.j.meisenzahl / citicorp.com wrote:
> I've seen how Ruby uses an initialize() method as a constructor.
> 
> Can this method be overloaded? After playing with IRB I'm assuming
> it can't?
> 
> Thanks very much again; Ruby and this list are great.

Actually, so far as I can tell, no method in Ruby can be overloaded.
(What looks like overloading is redefinition.)

Inasmuch as I've cared about overloading by type, I've handled the
dispatching myself. For good examples of this, look at my
initializers in Text::Format and MIME::Types. In all of these, I
handle a "copy constructor" case, a Hash case, and a NilClass case;
I also handle other types as appropriate.

-austin
-- Austin Ziegler, austin / halostatue.ca on 2002.11.21 at 10.16.15