Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

correct exception to throw for array index out of bounds #29

Open
dtm opened this Issue Jul 30, 2009 · 2 comments

Comments

Projects
None yet
2 participants
Collaborator

dtm commented Jul 30, 2009

Whats the correct exception to throw for an index out of bounds. Ruby/irb shows it as IndexError:
>> [1].insert(-10, 'boo')
IndexError: index -9 out of array
from (irb):6:in `insert'
from (irb):6

Contributor

treed commented Jul 31, 2009

Should be able to throw an IndexError. I declared the whole hierarchy of Ruby exceptions, except Errno::*.

(Catching is slightly more difficult if you want it to be fast.)

Contributor

treed commented Aug 12, 2009

Nope, the problems as evident in #36 will also mess with this. Awesome.

Waiting on Parrot TT#909 now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment