raja / cs.indiana.edu (Raja S.) wrote:
>Kevin Smith <sent / qualitycode.com> writes:
>
>>Correct me if I'm wrong, but it seems like Ruby's 
>>catch/throw takes care of this "abuse" of 
>>exceptions. If you want a clean way to exit deep 
>>nesting, use catch/throw. If you have a true 
>>error condition, use an exception. Right?
>
>You are right.  But I wouldn't term it an "abuse".

Fair enough. In a C++ context it's abuse. In 
Python, I understand it's an accepted idiom. 
That's why I put it in quote marks.

>Bottom line:  if you are going to use catch/throw be sure you don't need an
>              clean-up action the non-performance of which might leave your
>              system in an unstable state.

Ah, an important point. It makes sense, but I can 
see where it could be easy to make a mistake. 

>Hence 'exceptions' are more general/powerful than catch/throw --- Python's
>choice can be justified.  Ruby is an interesting amalgamation of concepts
>from various languages (i've started viewing it as having the evaluation
>model of Lisp/Scheme + the object model of Smalltalk + conventional
>syntax).

Thanks very much for your insightful comments and 
mini-history-lesson!

Kevin