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!o2g2000prl.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: not null Date: Wed, 4 Mar 2009 17:54:16 -0800 (PST) Organization: http://groups.google.com Message-ID: 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 1236218056 1002 127.0.0.1 (5 Mar 2009 01:54:16 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 5 Mar 2009 01:54:16 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: o2g2000prl.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:3959 Date: 2009-03-04T17:54:16-08:00 List-Id: On Mar 4, 12:38 pm, "Dmitry A. Kazakov" wrote: > Recursive types is not the single case where references are used. For smart > pointers not null constraint is very useful. Right, I didn't say a "not null" constraint isn't useful; I'm just saying that it's also useful to have access objects that *can* be null, if needed. Actually, I'm not clear on whether anyone disagrees with that. This points to a curiosity in Hoare's abstract: first he implies that inventing "null references" was a big mistake, and then he says "declarations for non-null references" is the solution. If allowing null references is a mistake, then the solution is to disallow them---not to allow the programmer to declare a reference that may not be null, right? I think maybe Hoare misstated the problem. The mistake wasn't inventing null references; the mistake was not providing a way for the programmer to disallow selected reference types or variables (objects) from being null. This misstatement may have led to some confusion on this thread. -- Adam