cardinal-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Cardinal-dev] Does Ruby require restartable exceptions?


From: Dan Sugalski
Subject: Re: [Cardinal-dev] Does Ruby require restartable exceptions?
Date: Thu, 30 May 2002 15:00:00 -0400

At 8:28 PM +0200 5/30/02, Erik Bågfors wrote:
On Thu, 2002-05-30 at 19:10, Dan Sugalski wrote:
 At 6:49 PM +0200 5/30/02, Erik Bågfors wrote:
 >On Thu, 2002-05-30 at 18:38, Dan Sugalski wrote:
 >>  Here's a question. Does Ruby require that you be able to catch an
 >>  exception then restart or resume from where the exception was thrown?
 >
 >AFAIK no,
 >
 >What you do in ruby is restart by hand.

 Cool. I was worried you could do something like:

 try {
     object.method_which_pitches_exception();
 } catch {
    resume;
 }

 and have the resume jump back into the object's method at the place
 where it threw the exception. Not having to do that makes life easier.

I've never seen that, but I'm not 100% sure about it.

Another thing you have in ruby is "throw" and "catch".  They have
nothing to do with the try/catch/throw that you have in for example
java.

Those are easily handled--they count as specific exception handlers,
and the engine supports them. (The syntax I used was all made up, and
its only syntax anyway, so it's not that important) You'll be able to
establish a dynamically scoped exception handler that will intercept
only one specific exception, a class of exceptions, a list of
exceptions, or suchlike things.
--
                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
address@hidden                         have teddy bears and even
                                      teddy bears get drunk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]