when i get value from array/deque, i prefer the 
[EAFP](https://stackoverflow.com/questions/11360858/what-is-the-eafp-principle-in-python)
 way. it is also possible in nim, but the IndexError has been deprecated, and 
IndexDefect is designed to be uncatchable. i found [this 
issue](https://github.com/nim-lang/Nim/pull/13908), but could not found any 
particular reason; i know "look before you leap" way to get thing done, and i 
do it in my little 
[gist](https://gist.github.com/haolian9/4adb17e64e2db759ca874c2575b731ec#file-server-nim-L55-L60).

so i really wonder why IndexError had been deprecated, especially in my opinion 
IndexError is similar to KeyError.

i asked this question in IM channel, but i did not get good answer before the 
question has been flushed away.

Reply via email to