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,887e603b44eb2706 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: null exclusion and generics Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1161262319.24061.19.camel@localhost.localdomain> Date: Fri, 20 Oct 2006 09:57:41 +0200 Message-ID: NNTP-Posting-Date: 20 Oct 2006 09:57:41 CEST NNTP-Posting-Host: 292d3df7.newsspool4.arcor-online.net X-Trace: DXC==ZICjlEWT\7JIDNcfSJ;bb[EFCTGGVUmh?DN\HXHJ4e80NCS\DDa:9ngE X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:7063 Date: 2006-10-20T09:57:41+02:00 List-Id: On Thu, 19 Oct 2006 15:08:17 -0500, Randy Brukardt wrote: > So all access types are initialized with null, and if the subtype is > null-excluding, that will automatically raise Constraint_Error. A null > exclusion is essentially a kind of constraint (it is not technically a > constraint, but that has to do with independence from other forms of > constraint). Think of it being like: > > subtype A is Integer range 1 .. 10; > > Obj : A := Integer'First; > > which also will raise C_E. (If we had allowed a way to declare automatic > initializations for scalar types -- something I wish we had done -- it would > have had a similar effect as the explicit initialization here). This is one more reason to finally introduce a sane construction/destruction model in Ada. Compromises never buy off. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de