comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Possible to recover default value of scalar type?
Date: Tue, 15 Dec 2020 08:35:32 +0100	[thread overview]
Message-ID: <rr9p04$17qd$1@gioia.aioe.org> (raw)
In-Reply-To: rr93bj$kno$1@franka.jacob-sparre.dk

On 2020-12-15 02:26, Randy Brukardt wrote:
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message

>>     Put_Line (String (1..10)'Default_Value); -- print garbage
> 
> The above isn't a legal attribute prefix in any case (can't slice a type).

I mean a subtype.

> And you don't need to because this is clearly an aggregate (which is legal
> in Ada 2012):
>      Put_Line (String'(1..10 => <>)); -- print garbage

Yes, I would prefer the box notation too. However having a proper name 
would has some advantages too:

    subtype S is T range T'Default_Value - 100..T'Default_Value + 100;

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

  reply	other threads:[~2020-12-15  7:35 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 [this message]
2020-12-17  0:43             ` Randy Brukardt
2020-12-15  1:21       ` Randy Brukardt
replies disabled

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