comp.lang.ada
 help / color / mirror / Atom feed
From: "Martin Dowie" <martin.dowie@baesystems.com>
Subject: Re: Ada 2005 box (<>) rules in default values
Date: Tue, 17 Jan 2006 09:35:01 -0000
Date: 2006-01-17T09:35:01+00:00	[thread overview]
Message-ID: <43ccb83c$1_1@glkas0286.greenlnk.net> (raw)
In-Reply-To: 43CCAB76.6050907@mailinator.com

Alex R. Mosteo wrote:
> Hi all,
[snip]
> with this will also be welcome).

Your understanding seems to be what John Barnes describes in his paper at
"http://www.gnat.com/ada_2005.php#":

"The main change is that the box notation <> is now permitted as the value
in a named aggregate. The meaning is that the component of the aggregate
takes the default value if there is one.
So if we have a record type such as

type RT is record A: Integer := 7; B: access Integer; C: Float; end record;

then if we write

X: RT := (A => <>, B => <>, C => <>);

then X.A has the value 7, X.B has the value null and X.C is undefined. So
the default value is that given in the record type declaration or, in the
absence of such an explicit default value, it is the default value for the
type. If there is no explicit default value and the type does not have one
either then the value is simply undefined as usual.

The above example could be abbreviated to

X: RT := (others => <>); "









  reply	other threads:[~2006-01-17  9:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-17  8:31 Ada 2005 box (<>) rules in default values Alex R. Mosteo
2006-01-17  9:35 ` Martin Dowie [this message]
2006-01-17 13:35 ` ME
2006-01-17 17:19   ` Pascal Obry
2006-01-17 20:25     ` Randy Brukardt
2006-01-17 20:29 ` Randy Brukardt
2006-01-17 21:15 ` Björn Persson
2006-01-18 11:04   ` Alex R. Mosteo
2006-01-18 14:09     ` Jean-Pierre Rosen
2006-01-18 15:59       ` Alex R. Mosteo
2006-01-18 21:54         ` Randy Brukardt
2006-01-19  9:19           ` Alex R. Mosteo
2006-01-18 21:32     ` Björn Persson
replies disabled

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