From: TAKAHASHI Masayoshi Date: 2001-08-08T00:14:57+09:00 Subject: [ruby-talk:19294] Re: Perl/Python/Ruby common backend (Parrot, can Ruby play too?) Tom Robinson wrote: > He might be talking about the way you can reopen and extend existing > _built_in_ classes in Ruby, for example: > > class Regexp > alias oldcomp =~ > def =~ (astring) > match(astring)[1..9] > end > end And you can extend existing built-in classes' *instance*: a = "foo" def a.foo ## add method 'foo' to String object print self+self end a.foo #=> "foofoo" TAKAHASHI 'Maki' Masayoshi E-mail: maki@open-news.com