From: Austin Ziegler Date: 2002-09-13T10:10:44+09:00 Subject: Re: not grasping the method overloading/multi-dispatch thing On Fri, 13 Sep 2002 07:22:35 +0900, Paul Brannan wrote: > On Fri, Sep 13, 2002 at 05:41:20AM +0900, Rich Kilmer wrote: >> def fred(*args) >> case args.collect { |a| a.type} >> when [Float, Fixnum, String] >> f, i, s = args >> # ... > > With this mechanism, how can I add a new signature to the list? > What if I want to extend fred() to work with GMP Integers? You could, of course, subclass the class that owns fred and then implement your match; if nothing matches, then you call the base parent. Or, perhaps, you use the aliasing feature. -austin -- Austin Ziegler, austin@halostatue.ca on 2002.09.12 at 21.07.41