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!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: private types Date: 25 Mar 2006 20:00:29 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1142279908.327131.230200@j52g2000cwj.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1143334829 14373 192.74.137.71 (26 Mar 2006 01:00:29 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sun, 26 Mar 2006 01:00:29 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:3619 Date: 2006-03-25T20:00:29-05:00 List-Id: Justin Gombos writes: > On 2006-03-25, Robert A Duff wrote: > > Justin Gombos writes: > > > > So you rarely create trees, linked list, etc? > > That's right. In fact, a few months ago was the first time I > implemented a dynamic container in Ada since I studied it in school. > I haven't had a need for them in any of the avionics systems that I've > worked. OK. I'm a compiler writer, so I use pointers (access types or whatever) quite a lot. > >> 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, > > > > No, zero has no 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. > > > > There is no "default initialization of zero". There is a > > default-init to null, which has nothing to do with zero (according > > to the Ada standard). > > You're forgetting why we got side tracked on this discussion. Sorry. These discussions tend to ramble a bit. ;-) >...Your > comment was: > > I'm not sure what the right answer is, but surely all the arguments > for and against dummy values apply equally to access types. And I stand by that comment. > Access types are special, and get different treatment than other > scalars because they include in their set a representation for a null > value. Yes, access types in Ada are special, because they have a special null value. C and Pascal and so forth are similar. But it doesn't HAVE to be that way. Some languages (SML comes to mind) do not have a special null value provided for free -- if you want one, you declare one. (Or, if you want two, you declare two!) >...Integers do not; so the same arguements for implicit > initialization of access values do not necessarily apply. Again, it doesn't have to be that way. The language designer could provide a special value for integers, too. Most of the time, I do not want a special null value (neither for access types nor for integers). I would prefer a language that did not give me special null values for free -- they're just a tripping hazard, except when I want them. The Ada 2005 "not null" thing is somewhat helpful, in this regard. > Whether null values are actually represented as zeros is irrelevant to > this matter. Quite true. Sorry -- I was confused by your referring to zero as a null access value. - Bob