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,e7d9fee9b42cd34e X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed-east.nntpserver.com!nntpserver.com!statler.nntpserver.com!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Not null feature with anonymous and named access types 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: <1150144396.104055.164310@f6g2000cwb.googlegroups.com> <6_kjg.4603$E02.1474@newsb.telia.net> <1150154013.951160.154270@j55g2000cwa.googlegroups.com> <15d5p0cbyr817.1vzzowtu2dayj$.dlg@40tude.net> <1150212476.630345.297100@c74g2000cwc.googlegroups.com> <4fana1F1i8fppU1@individual.net> <1150299433.315551.41490@g10g2000cwb.googlegroups.com> <18lx513zr1o49.lpffjwx41xi4.dlg@40tude.net> <1150343308.372654.225640@f6g2000cwb.googlegroups.com> <1xjx7454hmql7.14ype2u114tz2.dlg@40tude.net> Date: Sat, 17 Jun 2006 10:24:45 +0200 Message-ID: <1g1ccxlzutefg$.1g9gwe962gid7$.dlg@40tude.net> NNTP-Posting-Date: 17 Jun 2006 10:24:29 MEST NNTP-Posting-Host: 635a802e.newsread2.arcor-online.net X-Trace: DXC=WJ8nB3?;oHCZYo_CH;Uk?NQ5U85hF6f;DjW\KbG]kaMH[NGU2GAcMGJI;0c7@T6oeJWRXZ37ga[7JjTA67ckJ=XEF On Fri, 16 Jun 2006 20:21:10 -0500, Randy Brukardt wrote: > "Dmitry A. Kazakov" wrote in message > news:1xjx7454hmql7.14ype2u114tz2.dlg@40tude.net... > ... >> * There is a language design problem that not-null is a subtype constraint >> rather than a type, so Ada.Unchecked_Deallocation cannot reject >> instantiation with a not-null pointer, as it probably should. But that is >> a problem of generics, not of null-pointers. But this is another story. > > This is doubly wrong: "not null" is *not* a constraint (it's something else > altogether). I didn't check it, so I thought that GNAT was correct. Thank you for clarification. However, if anonymous not-null access is a distinct type then it cannot be implicitly converted to/from a (normal) anonymous access type, or? > And it is required to match on generic instantiations (the > version of GNAT used is wrong here, not the language). That is a good news (to Ada, I mean (:-))) > Note that Ada > requires matching constraints in some cases for generics (remember > "statically matching subtypes"?) -- this has nothing to do with types. Hmm, that was about the target type constraints. What I mean is that any access type is itself a type and could [potentially] have constrained subtypes with the constraints of its own. Not-null could be treated as such constraint. The storage pool could be another (if we wished to eliminate anonymous access types), discriminants, (if were allowed for access types) could be third. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de