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,839916f6ca3b6404 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!n33g2000pri.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: not null Date: Wed, 4 Mar 2009 17:47:03 -0800 (PST) Organization: http://groups.google.com Message-ID: <75e0862b-cb8d-4f47-b55e-e2c6235997ea@n33g2000pri.googlegroups.com> References: <49ae93bc$0$31872$9b4e6d93@newsspool3.arcor-online.net> <761a4fb8-de91-43b3-b420-55dbc06a61e7@k9g2000prh.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1236217623 28476 127.0.0.1 (5 Mar 2009 01:47:03 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 5 Mar 2009 01:47:03 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: n33g2000pri.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:3957 Date: 2009-03-04T17:47:03-08:00 List-Id: On Mar 4, 5:32 pm, Brian Drummond wrote: > On Wed, 4 Mar 2009 08:09:56 -0800 (PST), Adam Beneschan wrote: > >On Mar 4, 6:56 am, Hyman Rosen wrote: > >> Georg Bauhaus wrote: > >> > As said to have been seen on /. > >> > another financial disaster, again caused > >> > by making references to nothing, in Algol W, > >> >http://qconlondon.com/london-2009/presentation/Null+References:+The+B... > > >> You are misreading the abstract. First of all, it's not > >> about some particular incident. He's talking about the > >> overall impact. Second, he's not talking about failure > >> to check for null references, he's talking about having > >> null references at all, so Ada is no better. > > >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. To me, a circular list and a linked list that isn't circular are two different abstractions (perhaps they have different topological properties, in some sense). Forcing one to be implemented as the other is hardly a recipe for making programs more reliable. You could also make the "end of list" point to some special dummy object. That would probably be better than forcing the list to be circular, but again just as pointless. I believe my earlier comment, 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". -- Adam