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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ec21c3c7cdc7ff3e X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Mon, 20 Mar 2006 17:43:58 -0600 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1142279908.327131.230200@j52g2000cwj.googlegroups.com> <41LSf.4126$TK2.1805@trnddc07> Subject: Re: Handling invalid objects Date: Mon, 20 Mar 2006 17:44:06 -0600 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-YgnxvfGgO2YbfyQ2mp5eD8AUgBGX1M4ZUYQQx7LukAsqExqLhvws9z3LMP+y9o0y82hEU1KkrjgZOtI!dvvC7kBv7dCwcpLItJgguXZm+VmuEo4P7hsymYLIP36uTVI80OWsvbPF1TBj0phNMwvFfxoH4Du+ X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:3508 Date: 2006-03-20T17:44:06-06:00 List-Id: "Justin Gombos" wrote in message news:41LSf.4126$TK2.1805@trnddc07... > On 2006-03-18, Randy Brukardt wrote: > > > > You're confusing an "invalid" object with an "abnormal" > > object. Accessing an abnormal one is erroneous; surely you don't > > want to intentionally put that into your programs. (Remember, > > "erroneous" is Ada-speak for "anything at all can happen".) > > The 'Valid attribute exists to be able to handle abnormal objects. No, it exists to handle *invalid* objects. It has no effect on *abnormal* objects. Please be careful with your terminology here because using the *abnormal* the way you are is very confusing. I'm using the terminology defined in the Standard: see http://www.adaic.com/standards/05aarm/html/AA-13-9-1.html (or the similar section in the Ada 95 manual) to see the definitions of the terms. > Here's a concrete example. Suppose I have: Your example shows *invalid* values, not *abnormal* values. ... > Exceptions are a poor choice. No, I think they're the right choice here (presuming you are talking about clock failure or some other unusual event). > The quality and style guide advises against them for a good > reason; exceptions are like gotos - and produce a questionable state. The state isn't questionable in this case: you have no legitimate value to return, so anything you return is garbage. That means there isn't any state to corrupt. Randy.