"Reimer Behrends" <behrends / cse.msu.edu> wrote in message
news:slrn95uj0c.aht.behrends / allegro.cse.msu.edu...
..
> After giving it a closer look, I believe that singleton methods (those
> include module functions) cannot be aliased, because they are already
This not true --
class A
end
x = A.new
def x.s
  p 'okay'
end
class << x
alias :t :s
def s
   p 'whatever'
end
end
x.t  # okay
x.s # whatever
def x.t
  p 'still okay'
end
x.t  # still okay
x.s # whatever

> bound to a receiver (my understanding of the ruby sources is still
> partial, so I may be off). "system" is a special case, because it's
> found as a method in Object, which is the only "superclass" that
> modules have (somebody correct me if I'm wrong). alias_method is
> mainly useful for getting a copy of a method that you are about
> to redefine for inheritance.
...
Christoph