From: Mehdi Saada <00120260a@gmail.com>
Subject: Re: "unconstrained subtype in component declaration" vs "discriminant in constraint must appear alone"
Date: Mon, 22 Feb 2021 08:21:13 -0800 (PST) [thread overview]
Message-ID: <e0673262-4429-4486-b379-fd9524e2dae4n@googlegroups.com> (raw)
In-Reply-To: <s10k54$1nhh$1@gioia.aioe.org>
> There are three categories of "once":
> 2. Once per object instantiation, subtype/dynamic constraint
Sorry, I mean that, and it's meant to be mutable, for which I forgot the := default_discrimant_value).
> As J-P said, you can have whatever expressions in #1, just remove
> discriminants.
Actually
type CARDS_SETS (Nb: Nombre_cartes := 0) is record
Set: Sets_of_Card := INITIALIZATION (Nb);
end record;
gives "unconstrained subtype in component declaration" so I'm forced to put a constraint despite the defaults.
I would have supposed that the constraint would come from the default value, or from a value in an aggregate.
But I scrapped the "no 52" for
type CARDS_SETS (Nb: Nombre_cartes := 0) is record
Set: Sets_of_Card (1..Nb) := INITIALIZATION (Nb);
end record;
and it's good.
What a wealth of gems I can get from a bunch of cards X-D
next prev parent reply other threads:[~2021-02-22 16:21 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-22 0:14 "unconstrained subtype in component declaration" vs "discriminant in constraint must appear alone" Mehdi Saada
2021-02-22 6:32 ` J-P. Rosen
2021-02-22 10:14 ` AdaMagica
2021-02-22 10:57 ` Dmitry A. Kazakov
2021-02-22 14:20 ` Mehdi Saada
2021-02-22 15:11 ` J-P. Rosen
2021-02-22 15:55 ` Dmitry A. Kazakov
2021-02-22 16:21 ` Mehdi Saada [this message]
2021-02-23 22:06 ` Mehdi Saada
2021-02-24 9:59 ` AdaMagica
2021-02-24 10:04 ` Jeffrey R. Carter
2021-02-24 14:11 ` Simon Wright
2021-02-24 15:57 ` Shark8
2021-02-25 0:13 ` Mehdi Saada
2021-02-25 8:58 ` AdaMagica
2021-02-25 10:25 ` Mehdi Saada
2021-02-25 10:28 ` Mehdi Saada
2021-02-22 10:35 ` Jeffrey R. Carter
2021-02-22 14:21 ` Mehdi Saada
2021-02-22 15:02 ` Jeffrey R. Carter
2021-02-22 15:08 ` J-P. Rosen
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox