comp.lang.ada
 help / color / mirror / Atom feed
From: "chris.danx" <chris.danx@ntlworld.com>
Subject: Re: Whether to raise exception or End_of_List function
Date: Wed, 21 Nov 2001 17:09:04 -0000
Date: 2001-11-21T17:09:04+00:00	[thread overview]
Message-ID: <fcRK7.3316$AQ3.471314@news6-win.server.ntlworld.com> (raw)
In-Reply-To: 68RK7.3295$AQ3.467408@news6-win.server.ntlworld.com


> > My question is which is the better solution; Exception or a End_of_List
> > function and which would have fewer side effects?
>
> Have both!  i.e. an End_Of_List function for when you need to know when
> you've reached the end of a list, and an exception for when you fall of
the
> list and attempt to use it.
>
> I have a similar problem with a recent assignment, and I found both to be
> helpful (exceptions are for getting the bugs out, and knowing where they
are
> (although not all bugs are detectable by exceptions)).  An exception will
be
> generated anyway if your iterator attempts to use a null valued access
type
> (assuming that's how the implementation works), but you may want your own
> exception -- it can be helpful sometimes.

I wasn't clear there.  Exceptions are for catching bugs and unexpected
conditions, and *if possible* (and desirable) recover from them.  If not
then they are helpful when you need to fix a program.

Thought it best to be clear on that,
Chris


> Chris
>




  reply	other threads:[~2001-11-21 17:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-21 15:17 Whether to raise exception or End_of_List function Preben Randhol
2001-11-21 16:32 ` Preben Randhol
2001-11-21 16:51 ` Mark Biggar
2001-11-21 17:00   ` Preben Randhol
2001-11-21 17:01 ` Larry Kilgallen
2001-11-21 17:03   ` Preben Randhol
2001-11-21 19:34   ` Ed Falis
2001-11-21 17:04 ` chris.danx
2001-11-21 17:09   ` chris.danx [this message]
2001-11-21 22:00   ` Larry Kilgallen
2001-11-21 17:11 ` Jeffrey Carter
2001-11-21 17:53 ` Stephen Leake
2001-11-21 18:51   ` Preben Randhol
2001-11-22  3:53     ` Nick Roberts
2001-11-22 10:23       ` Preben Randhol
2001-11-23 14:37       ` Preben Randhol
replies disabled

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