From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.7 required=3.0 tests=BAYES_40,FREEMAIL_FROM, FROM_STARTS_WITH_NUMS autolearn=no autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:a05:620a:1e5:: with SMTP id x5mr19016517qkn.369.1614010873636; Mon, 22 Feb 2021 08:21:13 -0800 (PST) X-Received: by 2002:a25:268c:: with SMTP id m134mr35596547ybm.253.1614010873375; Mon, 22 Feb 2021 08:21:13 -0800 (PST) Path: eternal-september.org!reader02.eternal-september.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 22 Feb 2021 08:21:13 -0800 (PST) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=85.240.209.103; posting-account=rhqvKAoAAABpikMmPHJSZh4400BboHwT NNTP-Posting-Host: 85.240.209.103 References: <4086f350-c56b-4eec-91d3-ef685230b011n@googlegroups.com> <67ea71d9-489a-4802-9cf0-d955f6ecce62n@googlegroups.com> <0e88c615-6a53-4392-b83d-581c59473c88n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: "unconstrained subtype in component declaration" vs "discriminant in constraint must appear alone" From: Mehdi Saada <00120260a@gmail.com> Injection-Date: Mon, 22 Feb 2021 16:21:13 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:61419 List-Id: > 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