From: jmichel@... (Jean Michel) Date: 2000-12-31T21:10:02+09:00 Subject: [ruby-talk:8399] Re: My first impression of Ruby. Lack of overloading? (long) In article <978110491.341032.18639.nullmailer@ev.netlab.zetabits.com>, Yukihiro Matsumoto wrote: >... >How about using "double dispatch"? > > class Foo > def action(arg) > arg.action_Foo(self) > end > end > > class Bar > def action_Foo(arg) > ... action for combination of Foo and Bar > end > end > Nice concept. Does not this suggest that method + for Numeric behave like: def +(arg) if arg_can_be_considered_as_numeric do_addition_as_usual else arg.add_Numeric(self) end end rather than the current mechanism with coerce? Best regards, Jean MICHEL