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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,839916f6ca3b6404 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 05 Mar 2009 05:31:28 -0600 From: Brian Drummond Newsgroups: comp.lang.ada Subject: Re: not null Date: Thu, 05 Mar 2009 11:32:13 +0000 Reply-To: brian@shapes.demon.co.uk Message-ID: References: <49ae93bc$0$31872$9b4e6d93@newsspool3.arcor-online.net> <761a4fb8-de91-43b3-b420-55dbc06a61e7@k9g2000prh.googlegroups.com> <75e0862b-cb8d-4f47-b55e-e2c6235997ea@n33g2000pri.googlegroups.com> X-Newsreader: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-lGVAQuYXZzOurM90+ejsL4KUCiXWBqS64MBvxXrgLtxE18mFmH69NGmTmGDZj9feZzJg4IEAQMpT3Wz!vZFDnSlEgenjgBHgddsU+MkXG8XZ4b0QjyHZvydH0c5cKdB9grvIBo5WmjTVMwV53ptLyhvH/s3a!X/iy X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com 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.39 Xref: g2news2.google.com comp.lang.ada:4937 Date: 2009-03-05T11:32:13+00:00 List-Id: On Wed, 4 Mar 2009 17:47:03 -0800 (PST), Adam Beneschan wrote: >On Mar 4, 5:32 pm, Brian Drummond >wrote: >> On Wed, 4 Mar 2009 08:09:56 -0800 (PST), Adam Beneschan wrote: >> >I'm having difficulty understanding the point. You have to have the >> >idea of the lack of a reference. How else would you implement a >> >linked list abstraction? >> >> Possibly by pointing from the end back to the list head. >> >> It would make the "end of list" test more expensive (the head might have to be >> kept in a register or passed around as another argument). I don't think it would >> be pretty, but can't see any fundamental reason why it shouldn't work. > >Sure you could make it work, but what would be the point of doing so? >And would it be any less error-prone? Actually, it might even be >moreso---when writing the operation to insert an element at the front >of the list, you could forget to modify the reference in the tail. I wasn't suggesting it was a good idea... Agree on all the above; and the error wouldn't bes ignificantly easier to find. OTOH uninitialised (or incorrectly incremented) pointers in some languages cause real grief... (my Algol W days are so far behind me, I can't remember if an uninitialised reference was even possible) >You could also make the "end of list" point to some special dummy >object. I don't see that as semantically different from a null pointer. Which perhaps just helps to make your point >that the same set of mistakes applies as to a language that involves >null reference, but the syntax of those mistakes is different, applies >to both of these "solutions". In which case, Hoare's point remains a mystery to me. - Brian