From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Possible to recover default value of scalar type?
Date: Mon, 14 Dec 2020 19:21:53 -0600 [thread overview]
Message-ID: <rr933i$kid$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: 82e629ea-bd59-417a-9185-dd6094e396c1n@googlegroups.com
"AdaMagica" <christ-usch.grein@t-online.de> wrote in message
news:82e629ea-bd59-417a-9185-dd6094e396c1n@googlegroups.com...
>I do not really understand the problem. It seems you want to be able to
>access the default value like so:
> N: Natural := Natural(A_Type'Default_Value);
> This is not possible. Thre is no corresponding attribute 'Default_Value.
> If this presents a real problem, submit it to Ada comment stating why this
> is important.
We considered an attribute like that, but it becomes a semantic problem if
the type doesn't have a Default_Value and you are in a context where you
don't know (such as for a generic formal type). I vaguely remember some
other semantic problem, but I don't remember the details. These things could
be worked out, but it seemed messy.
I've long wanted <> to work as it does in aggregates generally (if that
existed, I'd also have a restriction to require all objects to be
initialized; that would provide an encouragement to initialize as many
objects as possible; right now, the iffy thing (not initializing) is the
easiest).
Randy.
prev parent reply other threads:[~2020-12-15 1:21 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-13 9:54 Possible to recover default value of scalar type? reinert
2020-12-14 0:08 ` Stephen Leake
2020-12-14 6:09 ` reinert
2020-12-14 9:01 ` AdaMagica
2020-12-14 9:38 ` Dmitry A. Kazakov
2020-12-14 15:56 ` AdaMagica
2020-12-14 16:31 ` Dmitry A. Kazakov
2020-12-14 18:24 ` Simon Wright
2020-12-14 18:53 ` Dmitry A. Kazakov
2020-12-15 6:47 ` J-P. Rosen
2020-12-15 7:23 ` Dmitry A. Kazakov
2020-12-15 9:07 ` J-P. Rosen
2020-12-15 16:53 ` Simon Wright
2020-12-15 18:14 ` AdaMagica
2020-12-17 0:53 ` Randy Brukardt
2020-12-17 0:48 ` Randy Brukardt
2020-12-15 1:27 ` Randy Brukardt
2020-12-15 9:30 ` Niklas Holsti
2020-12-17 0:45 ` Randy Brukardt
2020-12-15 1:26 ` Randy Brukardt
2020-12-15 7:35 ` Dmitry A. Kazakov
2020-12-17 0:43 ` Randy Brukardt
2020-12-15 1:21 ` Randy Brukardt [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