From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_05,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!igor!rutabaga!jls From: jls@rutabaga.Rational.COM (Jim Showalter) Newsgroups: comp.lang.ada Subject: Re: Exceptions vs. if-then-else Message-ID: Date: 26 Mar 91 02:26:49 GMT References: <9103211807.AA22650@bunny.gte.com> Sender: news@Rational.COM List-Id: >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."