comp.lang.ada
 help / color / mirror / Atom feed
From: pattis@cs.washington.edu (Richard Pattis)
Subject: Re: Optional Sequence of Statements Before Exception Handlers
Date: 30 Jun 90 17:21:26 GMT	[thread overview]
Message-ID: <12427@june.cs.washington.edu> (raw)
In-Reply-To: 34741@vrdxhq.verdix.com

In article <34741@vrdxhq.verdix.com>, edm@vrdxhq.verdix.com (Ed Matthews) writes:
> I've been thinking about the following situation recently:
> 
>   exception
>     when foo_error =>
>       A;
>       B;
>     when bar_error =>
>       A;
>       B;
>       C;
>     when others =>
>       A;
>       B;
>       D;
>   end;
> 
> and wondering if allowing the following would be a "good thing:"
> 
>   exception
>     A;
>     B;  -- these two statements comprise the optional sequence before handlers
>     when foo_error =>
>       null;
>     when bar_error =>
>       C;
>     when others =>
>       D;
>   end;
> 

How about:


EXCEPTION
  WHEN OTHERS =>
      A;
      B;
      BEGIN
        RAISE;
      EXCEPTION
         WHEN foo_error => NULL;
         WHEN bar_error => C;
         WHEN others    => D;
      END;
      -- Can put post statements here (done for all exceptions)
END;

Rich Pattis

PS: Actually, I've never programmed this, but I have thought about it; if it
won't work, I'm sure some kind soul will tell me so, loudly.

  reply	other threads:[~1990-06-30 17:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-06-29 14:15 Optional Sequence of Statements Before Exception Handlers Ed Matthews
1990-06-30 17:21 ` Richard Pattis [this message]
1990-07-03  9:51   ` Daniel Wengelin
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox