comp.lang.ada
 help / color / mirror / Atom feed
From: edm@vrdxhq.verdix.com (Ed Matthews)
Subject: Optional Sequence of Statements Before Exception Handlers
Date: 29 Jun 90 14:15:38 GMT	[thread overview]
Message-ID: <34741@vrdxhq.verdix.com> (raw)

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;

This obviously poses some awkward spots -- like the null; statement with
non-null semantics and if an exception occurs in the optional sequence
of statement, where/how/in which scope it can be handled.  

Of course, we can always write a procedure encapsulating A; B; and call it
from each of the handlers.  Then we get into the wouldn't it be nice if
we could pass parameters to handlers and access the name of the exception
(or an enumeration literal representing the exception) in a standard manner.

Anybody know what the current thinking about exception handling is with
respect to 9X?
-- 

Ed Matthews                                                edm@verdix.com
Verdix Corporation Headquarters                            (703) 378-7600
Chantilly, Virginia

             reply	other threads:[~1990-06-29 14:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-06-29 14:15 Ed Matthews [this message]
1990-06-30 17:21 ` Optional Sequence of Statements Before Exception Handlers Richard Pattis
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