comp.lang.ada
 help / color / mirror / Atom feed
From: jls@rutabaga.Rational.COM (Jim Showalter)
Subject: Re: Exceptions vs. if-then-else
Date: 26 Mar 91 02:26:49 GMT	[thread overview]
Message-ID: <jls.669954409@rutabaga> (raw)
In-Reply-To: 9103211807.AA22650@bunny.gte.com

>I don't know of any machine nor compiler which guarrantees that an Ada
>statement is non-interruptible. Some machines don't even guarantee that
>a decrement memory location machine instruction is atomic.

Mea culpa--my apologies to the N people who beat me about the
head and shoulders for this one. Yes, absolutely right--statements
are not necessarily atomic. I obviously need to get more sleep!

So, my argument in favor of the exception version of the Pop operation
comes down to this: I think you should use exceptions whenever they
are not part of the NORMAL flow of control. Of course, this is an
inherently subjective criterion, but ask yourself this--is it NORMAL
for a client to Pop an empty stack? I think not, so I think writing
Pop without a pre-check is fine.

--
***** DISCLAIMER: The opinions expressed herein are my own. Duh. Like you'd
ever be able to find a company (or, for that matter, very many people) with
opinions like mine. 
              -- "When I want your opinion, I'll read it in your entrails."

      reply	other threads:[~1991-03-26  2:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1991-03-21 18:07 Exceptions vs. if-then-else Ray Diederich (301)-294-8400
1991-03-26  2:26 ` Jim Showalter [this message]
replies disabled

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