From: Phrogz Date: 2007-05-18T08:00:07+09:00 Subject: Re: questions about reimplementing core classes On May 17, 3:40 pm, "Giles Bowkett" wrote: > Quick thing - I know Array is implemented in C rather than in Ruby. > This is probably true for Hash as well. There's two points here: > first, if you were patching Array directly, you could rewrite [] and > it would still drop to the C implementation (if I understand > correctly). a = [1,2,3] def a.[]( bar ) "You want element #{bar.inspect}? Too bad!" end puts a[2] #=> You want element 2? Too bad! p a.class #=> Array