> "Hal E. Fulton" <hfulton / austin.rr.com> writes:
> 
> > This seems like a good idea to me...  Other comments?
> 
> In an abstract sense it sounds like a good idea -- you could
> incorporate reason codes, messages, retry flags and so on in a failure 
> object.
...
>    If the match succeeds, it returns the offset of the start. That's
>    not nil or false, so the expression is true. But if the match
>    fails and the expression returns a failure object, what do we
>    do. Do we build in to the interpreter the fact that failure is
>    false? There mau be some issues there, noy just with performance,
>    but also logically. Alternatively if failure is not false, then

Well, since failure is a fundamental concept common to almost all methods, we
could leave the existing function's return value/type alone and have a
different, special way of returning for failure.  Haskell has a
"Error | OK val" monad, that, with the help of the usual monadic functions,
can be 'lifted' across other function calls so that an error propagates
through the program until it is caught and handled.  ruby doesn't have the
same functionality (oops, pun), so we'd have to build it into the language,
and make it almost a sort of control structure.  It could be generalized to
indicate any exceptional circumstance in addition to errors, and to reflect
that, we could call it

an exception


:)