From: Iain Barnett Date: 2010-08-27T02:49:37+09:00 Subject: Re: Initialise On 26 Aug 2010, at 15:54, Brian Candler wrote: > class Object > alias :old_initialize :initialize > def initialize(*args,&blk) > if respond_to? :initialise > initialise(*args,&blk) > else > old_initialize(*args,&blk) > end > end > end > > class Foo > def initialize(n) > @n = n > end > end > > class Bar > def initialise(m) > @m = m > end > end > > p Foo.new(123) > p Bar.new(456) > > You get a warning about redefining initialize, but it seems to work. Thanks, I'll give that a shot. > >> I suppose my only recourse now is to start >> hacking on the Ruby source and get my patch submitted in time for Ruby >> 2.0 :) > > That will be released some time between perl 6 and hell freezing over > :-) I was thinking of using Perl6 to write Ruby2.0 :) Regards Iain