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=AC_FROM_MANY_DOTS,BAYES_00, HK_RANDOM_FROM autolearn=no 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!news2.google.com!atl-c05.usenetserver.com!news.usenetserver.com!cycny01.gnilink.net!spamkiller.gnilink.net!gnilink.net!trnddc06.POSTED!20ae255c!not-for-mail Newsgroups: comp.lang.ada From: Justin Gombos Subject: Re: private types References: <1142279908.327131.230200@j52g2000cwj.googlegroups.com> User-Agent: slrn/0.9.8.1 (Linux) Message-ID: Date: Sat, 18 Mar 2006 15:06:29 GMT NNTP-Posting-Host: 129.44.77.228 X-Complaints-To: abuse@verizon.net X-Trace: trnddc06 1142694389 129.44.77.228 (Sat, 18 Mar 2006 10:06:29 EST) NNTP-Posting-Date: Sat, 18 Mar 2006 10:06:29 EST Xref: g2news1.google.com comp.lang.ada:3435 Date: 2006-03-18T15:06:29+00:00 List-Id: On 2006-03-18, Robert A Duff wrote: > > In Ada, if an object of an access type has no explicit initial > value, you can't easily tell whether that means "null is a > meaningful value for this variable, and that's the default I want" > versus "this variable will be initialized to a meaningful (non-null) > value later". If you want to distinguish between the two possiblities, you could explicitly initialize your pointers to null in the first case, and not in the second. I rarely use access types, and I probably wouldn't do that myself simply because I find the distinction unimportant for access types. Regardless, I'm not going to give up the benefit of having this distinction on non-access scalars simply because my access type declarations don't have it. > This is exactly analogous to the case with integers -- if they were > default-initialized to zero, you can't easily tell whether zero is > intended as a meaningful initial value, versus later initialization > to a meaningful value. Integers, and other non-access scalars are different in this case because you cannot expect zero to have the same meaning. Zero has a universal meaning with access types, but it could be in range or out of range for any other type. The ARM selects access types specifically to get a default initialization of zero for this reason. -- PM instructions: do a C4esar Ciph3r on my address; retain punctuation.