Boost logo

Boost Users :

From: Jeff Faust (jeff_at_[hidden])
Date: 2002-09-19 14:28:07


> I think you're imposing your own experience on the question.

Admittedly, I am using my own experience on the question. Without the
experience, I would have had the common decency to remain quiet on the
issue.

> Reaching the "end node" is an exceptional case.

An exceptional case that happens with every run can hardly be called
exceptional.

> It is clear from the discussion that I'm not alone in viewing this as a
normal use of exceptions.

Nor am I alone.

I don't know what the best solution is--I'm not sufficiently familiar with
the OP's problem. Maybe it's not a common need and shouldn't be part of the
algorithm. Maybe making it part of the algorithm would slow it down too
much to be effective. Maybe exceptions are the best way to handle this in
light of everything else.

What I do know, as constrained by my experience, is that exceptions are not
usually used in this manner. It's different and a bit "tricky", but it
produces the results you need. This type of reasoning, in my experience, is
best met with suspicion, and should be approached in full awareness of the
issues. That doesn't make it wrong.

Jeff

-----Original Message-----
From: Steve M. Robbins [mailto:steven.robbins_at_[hidden]]
Sent: Thursday, September 19, 2002 11:39 AM
To: Boost-Users_at_[hidden]
Subject: Re: [Boost-Users] Re: [BGL] Best way to abort an algorithm from
withi n a visitor?

On Thu, Sep 19, 2002 at 11:04:12AM -0700, Jeff Faust wrote:

> > > Exceptions are meant for exceptional cases. [...]
> >
> > Define "exceptional cases". How exceptions work is well defined, and
> > therefore can be understood, whereas an "exceptional case" is always
> > assumed to be intuitively obvious.
>
> Something unexpected. The example give by the original poster is
describing
> a normal execution. This is not unexpected. It's strange to think that
> what occurs in the catch block is not error recover/reporting, but normal
> and expected execution. This is not an obvious usage of exceptions.

I think you're imposing your own experience on the question. In the
case at hand, using an exception seemed perfectly natural to *me*, for
all the reasons that Jeremy just outlined. It is clear from the discussion
that I'm not alone in viewing this as a normal use of exceptions.

Think of it this way: the normal course of action for a "visitor" is
to process a node. Reaching the "end node" is an exceptional case.

-Steve

Info: <http://www.boost.org>
Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl>
Unsubscribe: <mailto:boost-users-unsubscribe_at_[hidden]>

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net