From: Mikkel Damsgaard Date: 2001-09-18T02:35:08+09:00 Subject: [ruby-talk:21288] SV: Re: Exceptions and Ruby > > If you prefer "safer" programming you can always use fetch > or change the > > implementation of [] > > > > class Hash > > def [](x) > > fetch(x) > > end > > end > > Don't do this. It is very likely to break something. > > Paul > A much better alternative is to make a new class. ie. class JavaLikeArray < Hash def [](x) fetch(x) end end