comp.lang.ada
 help / color / mirror / Atom feed
From: dst17!mab@ford-wdl1.arpa  (Mark A Biggar)
Subject: Re: Exceptions in Declarative Region
Date: 12 Aug 93 22:58:10 GMT	[thread overview]
Message-ID: <1993Aug12.225810.15902@wdl.loral.com> (raw)

In article <1993Aug12.185359.6400@iplmail.orl.mmc.com> rgilbert@orl.mmc.com wri
tes:
>The LRM (11-4.2a) specifies that exceptions that occur in the
>decarative portion are propagated up to the calling procedure
>and not handled by the current function's exception handler.
>Can somebody provide the rationale for this?  Why shouldn't the
>exception handler for a procedure/function not include the
>declarative portion?

Because, in general, there is not much that you can do in the
procedure's handler that's useful, except re-raise the exception.  Yes,
you can contrive cases where it might be useful, but they almost never
occure in real programs.  Besides, no visible effects on the outside
world can have happened yet.  OUT and IN-OUT parameters and global
variables have yet to be touched (except in the pathological case of
a function called as an initializer that modifies global variables,
which is pretty poor programming practice anyway and should be
discouraged strongly.)  Also, any exception raised in the declarative
part prevents any tasks declared or created in the declarative part
from even starting (remember tasks are started up just before the first
statement and after the whole declarative part is done), so no task
clean up is needed either.

--
Mark Biggar
mab@wdl.loral.com

             reply	other threads:[~1993-08-12 22:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-08-12 22:58 Mark A Biggar [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-08-16 12:22 Exceptions in Declarative Region Wes Groleau x1240 C73-8
1993-08-13  4:16 cis.ohio-state.edu!magnus.acs.ohio-state.edu!math.ohio-state.edu!sdd.hp.c
1993-08-13  3:49 Michael Feldman
1993-08-13  3:27 Michael Feldman
1993-08-13  3:23 Michael Feldman
1993-08-13  2:49 Dave Bashford
1993-08-12 23:02 Mark A Biggar
1993-08-12 22:34 Dave Bashford
1993-08-12 18:53 agate!howland.reston.ans.net!vixen.cso.uiuc.edu!sdd.hp.com!col.hp.com!csn
replies disabled

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