comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: [Not important] the “not null” notation in Ada 2005
Date: Sat, 26 Mar 2011 08:02:45 +0100
Date: 2011-03-26T08:02:44+01:00	[thread overview]
Message-ID: <mivzlnoflrrg$.q4l1m4pidzdt$.dlg@40tude.net> (raw)
In-Reply-To: op.vswop2cgule2fv@index.ici

On Fri, 25 Mar 2011 16:45:28 +0100, Yannick Duchêne (Hibou57) wrote:

> I remember some peoples says here, this is a pity to have “not null”  
> annotations, while the case which should be clearly marked, is the one  
> where a reference may be null. I'm OK with that principle. But concretely  
> what would have been the notation ? “may be null” ? Two reserved words  
> added for that ? A simple “null” would not have been really expressive  
> (just a though I get right a few minutes ago).

No notation needed. Before Ada 2005 broke it, "access T" was not null, if
anonymous type is what you mean.

Named type is a different beast. When you declare a named access type "not
null" is a constraint. You cannot have a constrained subtype before the
type.

Yet another story is an access type, which does not have null as a value.
It is not much different from being constrained. Compare it with integer
types. When you declare:

   type P is range 1..2;

You do not eliminate 0, as you might think. P has a "parent type," which
still has 0 (P'Base).

So which case you meant? (:-))

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



      parent reply	other threads:[~2011-03-26  7:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-25 15:45 [Not important] the “not null” notation in Ada 2005 Yannick Duchêne (Hibou57)
2011-03-25 15:51 ` Robert A Duff
2011-03-25 16:43   ` Yannick Duchêne (Hibou57)
2011-03-25 17:13     ` Robert A Duff
2011-03-25 17:29       ` Yannick Duchêne (Hibou57)
2011-03-26  7:02 ` Dmitry A. Kazakov [this message]
replies disabled

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