From: Dale Stanbrough <dstanbro@bigpond.net.au>
Subject: Re: Ada exceptions. unchecked?
Date: Wed, 12 Jun 2002 22:21:10 GMT
Date: 2002-06-12T22:21:10+00:00 [thread overview]
Message-ID: <dstanbro-E28877.08195613062002@news-server.bigpond.net.au> (raw)
In-Reply-To: 3D0771D3.FFEA1AA4@san.rr.com
Darren New wrote:
> For a sloppy and imprecise example,
> application's main calls file_open_dialog,
> file_open_dialog calls gui_button_handler
> gui_button_handler calls application's load_file
> application's load_file calls Java's read, which throws EOF_error.
>
> At this point, the application's load_file has to get the error back to the
> application's main routine to be handled. But the gui_button_handler doesn't
> declare that it can throw EOF_error, because the button hasn't anything to
> do with files. So the normal technique is to create a new unchecked
> exception and pass the checked exception in the constructor, then throw
> that, then catch it in the main routine and unwrap it.
Note that this problem would also apply if exceptions had
to be declared in a subprogram, and those subprograms were used
in a generic.
For example I have a convenience generic to iterate over each line
of a file - you pass a procedure that does the work on each line.
Clearly the generic can't know what exceptions the procedure could
generate.
Dale
next prev parent reply other threads:[~2002-06-12 22:21 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-12 7:00 Ada exceptions. unchecked? steve_H
2002-06-12 13:52 ` Ted Dennison
2002-06-12 14:09 ` Larry Kilgallen
2002-06-12 13:47 ` Mark Johnson
2002-06-12 15:40 ` Larry Kilgallen
2002-06-12 16:07 ` Darren New
2002-06-12 22:21 ` Dale Stanbrough [this message]
2002-06-13 14:36 ` Hyman Rosen
2002-06-13 16:41 ` Darren New
2002-06-13 17:13 ` Hyman Rosen
2002-06-13 17:48 ` Darren New
2002-06-13 18:06 ` Hyman Rosen
2002-06-13 18:37 ` Darren New
2002-06-13 19:14 ` Hyman Rosen
2002-07-05 14:35 ` Stephen J. Bevan
2002-06-12 19:25 ` Simon Wright
2002-06-12 22:19 ` Gisle Sælensminde
2002-06-13 14:27 ` Mark Johnson
2002-06-14 21:32 ` Gisle Sælensminde
2002-06-14 21:45 ` Darren New
2002-06-15 15:10 ` Simon Wright
2002-06-15 21:26 ` AG
2002-06-15 23:37 ` Darren New
2002-06-15 23:50 ` AG
2002-06-15 23:57 ` Darren New
2002-06-17 18:21 ` Charles Lindsey
2002-06-18 16:32 ` Stephen Leake
2002-06-18 19:48 ` Wes Groleau
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox