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 Path: g2news2.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: not null Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <49ae93bc$0$31872$9b4e6d93@newsspool3.arcor-online.net> <761a4fb8-de91-43b3-b420-55dbc06a61e7@k9g2000prh.googlegroups.com> <3234a1e2-5f7a-4a26-8b7b-65e3ac67d65f@s20g2000yqh.googlegroups.com> <1so528ceh38jq$.uws9l96ursub.dlg@40tude.net> Date: Fri, 6 Mar 2009 18:48:58 +0100 Message-ID: <11kj0o80w9j7k.15bjz2vugzuvv$.dlg@40tude.net> NNTP-Posting-Date: 06 Mar 2009 18:48:59 CET NNTP-Posting-Host: 8a699702.newsspool1.arcor-online.net X-Trace: DXC=`^0LAFXI<5eEB;5>eE0T7mic==]BZ:afn4Fo<]lROoRa^YC2XCjHcbi<`c65>C[B[lDNcfSJ;bb[eIRnRBaCdL4kJgWSLJf X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:4966 Date: 2009-03-06T18:48:59+01:00 List-Id: On Fri, 6 Mar 2009 08:59:41 -0800 (PST), Harald Korneliussen wrote: > On Mar 6, 4:21�pm, "Dmitry A. Kazakov" > wrote: >> On Fri, 6 Mar 2009 04:01:45 -0800 (PST), Harald Korneliussen wrote: >>> On Mar 4, 5:09�pm, 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? >> >>> You can use algebraic data types to do that in a type safe manner. >> >> No, you cannot, if safe = static. The nodes of the list have contracts to >> support certain operations. The only problem with null is that the virtual >> object corresponding to null does not fulfill the contract: > > I don't understand your code example. But kind of like some Java > functions won't compile unless they're surrounded by an appropriate > try/catch block, you can make in Haskell a linked list get_next > function that causes the compiler to protest - at compile time, > naturally - if used in a context where the possibility of returning > Nothing (null) isn't considered. But this has nothing to do with null as a value. It does to exception handling. The problem was moved to the client, which is the point. (It is a pity that Ada does not have contracted exceptions.) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de