comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Not null feature with anonymous and named access types
Date: Sat, 17 Jun 2006 10:24:45 +0200
Date: 2006-06-17T10:24:29+02:00	[thread overview]
Message-ID: <1g1ccxlzutefg$.1g9gwe962gid7$.dlg@40tude.net> (raw)
In-Reply-To: UuWdnd62cYlGxQ7ZnZ2dnUVZ_r6dnZ2d@megapath.net

On Fri, 16 Jun 2006 20:21:10 -0500, Randy Brukardt wrote:

> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> 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



  reply	other threads:[~2006-06-17  8:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-12 20:33 Not null feature with anonymous and named access types Anh Vo
2006-06-12 21:26 ` Björn Persson
2006-06-12 23:13   ` Anh Vo
2006-06-13  7:53     ` Dmitry A. Kazakov
2006-06-13 15:27       ` Anh Vo
2006-06-14 15:13         ` Alex R. Mosteo
2006-06-14 15:37           ` Anh Vo
2006-06-14 17:00             ` Dmitry A. Kazakov
2006-06-15  3:48               ` Anh Vo
2006-06-15  8:21                 ` Dmitry A. Kazakov
2006-06-17  1:21                   ` Randy Brukardt
2006-06-17  8:24                     ` Dmitry A. Kazakov [this message]
2006-06-17 14:24                     ` Robert A Duff
2006-06-19 23:17                       ` Randy Brukardt
2006-06-15 10:50                 ` Alex R. Mosteo
2006-06-17  1:16 ` Randy Brukardt
2006-06-17 14:25   ` Robert A Duff
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox