From: Robert Klemme Date: 2006-01-12T20:08:05+09:00 Subject: Re: [SPAM] safe array index ? David Vallner wrote: > Phrogz wrote: > >> Christer Nilsson wrote: >> >> >>> class SafeArray < DelegateClass(Array) >>> def [](index) >>> fetch index >>> end >>> end >>> >>> >> >> Or, even easier: >> >> class SafeArray < DelegateClass(Array) >> alias_method :[], :fetch >> end >> >> > Groan at the different argument order of the alias statement and > #alias_method. >> class Foo >> def bar() "bar" end >> alias :b :bar >> end => nil >> Foo.new.b => "bar" >> class Bar >> def foo() "foo" end >> alias_method :f, :foo >> end => Bar >> Bar.new.f => "foo" It seems to me order is the same: first the new name then the old name. Am I missing something here? Kind regards robert