comp.lang.ada
 help / color / mirror / Atom feed
From: Dr Nancy's Sweetie <kilroy@elvis.rowan.edu>
Subject: Re: Good Ada Style For Impossible Actions?
Date: Mon, 28 Oct 2002 03:52:36 GMT
Date: 2002-10-28T03:52:36+00:00	[thread overview]
Message-ID: <8w2v9.20054$T_.485432@iad-read.news.verio.net> (raw)
In-Reply-To: 3DBB0508.6010707@acm.org

Jeffrey Carter wrote, in reply to a question about when to use exceptions
and functions for testing error conditions:
> It sounds as if you could have mouse events outside the proper window
> at any time, so such an event would not be exceptional. So having a
> function would probably be a good idea.
>
> But if you use the function and still get a mouse event outside the
> proper window, you should also have an exception to indicate that.

If the function tries to compute a logical address for an invalid
mouse position, a CONSTRAINT_ERROR will be raised because the logical
position will be outside its valid range.

Is there a good heuristic for "raise your own exception" and "don't
clutter up the exception namespace"?


Darren Provine ! kilroy@elvis.rowan.edu ! http://www.rowan.edu/~kilroy
"C++ is like jamming a helicopter inside a Miata and expecting some
 sort of improvement." -- Drew Olbrich



  reply	other threads:[~2002-10-28  3:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-26 15:59 Good Ada Style For Impossible Actions? Dr Nancy's Sweetie
2002-10-26 21:11 ` Jeffrey Carter
2002-10-28  3:52   ` Dr Nancy's Sweetie [this message]
2002-10-28 17:13     ` Jeffrey Carter
2002-10-28 17:33       ` tmoran
2002-10-29  1:35         ` Dr Nancy's Sweetie
2002-10-28 17:52       ` Warren W. Gay VE3WWG
replies disabled

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