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!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: Fri, 17 Mar 2006 19:32:13 -0600 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1142279908.327131.230200@j52g2000cwj.googlegroups.com> Subject: Re: private types Date: Fri, 17 Mar 2006 19:32:20 -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-SWTP5C8NTPIApYZ1tOBjMIjZi9UMFWNGTOLGc95qMMnTXj7za91fEe/gTqDLK+k7fUPJ9tBT3jD8kwr!1LEvNlwSVNk5qSfkMDHSlvLLrrBgOHUNXhK0Ok6cAL9oswtkL6TzId9Tp43//1rTiJq2ZGQtqSDT!4ym7WRcVjJL+sA== 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:3420 Date: 2006-03-17T19:32:20-06:00 List-Id: "Justin Gombos" wrote in message news:FJHSf.1898$TK2.497@trnddc07... ... > BTW- I sometimes have a use for creating an abnormal object, and find > Ada lacking in not providing such a mechanism. I'm sometimes > forced to either include abnormal values in the set of values > declared for a type, or to have a seperate flag. Both of these > are messy. Why not have a 'invalid function added to Ada to > enable simple and explicit initialization of abnormal objects? 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 reason there is no way to construct invalid values is simple: there is no requirement that an implementation provide any such values. Some types (like Integer) don't have any invalid values; what would 'Invalid return for them. (This is the reason that Normalize_Scalars doesn't require initialization to invalid values.) Moreover, "invalid" only applies to scalar objects; there is no similar concept for composite types. In any case, this is a very complex area, and I don't think anyone wants to tread here. I'm dubious about your problem anyway; the values you are talking about are clearly part of the value set of a type. Claiming that they are not and trying to avoid including them is just confusing. "Null", for instance, is just another normal value (there are no valid or invalid values for access types, as they are not scalar) for an access type. Sure, it means "no object", and that's a bit unusual, but it's clearly an expected value. Randy.