From: James Edward Gray II Date: 2006-10-13T22:07:01+09:00 Subject: Re: Any way to get lists to throw exceptions on incorrect accesses? On Oct 12, 2006, at 11:26 PM, Kenneth McDonald wrote: > Yep, got that one. Unfortunately, there's no equivalent for lists. >> array, hash = Array.new, Hash.new => [[], {}] >> array.fetch(999) IndexError: index 999 out of array from (irb):2:in `fetch' from (irb):2 from :0 >> hash.fetch(:missing) IndexError: key not found from (irb):3:in `fetch' from (irb):3 from :0 James Edward Gray II