From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:ac8:93d:: with SMTP id t58mr20899861qth.217.1574527811721; Sat, 23 Nov 2019 08:50:11 -0800 (PST) X-Received: by 2002:aca:5145:: with SMTP id f66mr16119720oib.0.1574527811605; Sat, 23 Nov 2019 08:50:11 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!feeder5.feed.usenet.farm!feed.usenet.farm!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!g89no2868763qtd.0!news-out.google.com!p4ni1612qtu.1!nntp.google.com!g89no2868758qtd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 23 Nov 2019 08:50:11 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=70.109.61.2; posting-account=QF6XPQoAAABce2NyPxxDAaKdAkN6RgAf NNTP-Posting-Host: 70.109.61.2 References: <358a3934-7cb2-4cff-8703-71410815f27e@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0e718cae-0276-48a5-b39f-a809b82e41ff@googlegroups.com> Subject: Re: Initializing an array of tasks with discrimants From: Jere Injection-Date: Sat, 23 Nov 2019 16:50:11 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:57603 Date: 2019-11-23T08:50:11-08:00 List-Id: On Saturday, November 23, 2019 at 4:12:59 AM UTC-5, Randy Brukardt wrote: > "Robert A Duff" wrote in message > > Jere writes: > > > >> Is there a particular aggregate that I can use to avoid > >> the superfluous wrapper record? > > > > See AI12-0212-1.TXT. Not yet implemented in GNAT, > > as far as I know. > > If you wanted the indexes in order, you could use AI12-0061-1 (but I don't > know if that is implemented in GNAT yet, either): > > (for I in 1 .. 10 => (D => I, others => <>)) > > That still needs the wrapper record as I don't think you can write an > aggregate for a task. But a lot shorter. > > Randy. yeah, I think I shot myself in the foot by trying to make the example as simple as possible. My issue wasn't how to generate the discriminants but simply how to initialize the task types that had discriminants. I mentioned in a separate email that the real sceanrio is configuration values defined by enumerations that change how the task works in slight ways. They wouldn't be unique or in any order. My hope was that since Ada is so strongly typed I could have done something like T'(D => Some_Option) and Ada would know that since T is a task type it could correctly distinguish it wasn't a record type instead. At least GNAT cannot. The wrapper record feels superfluous. I"m not creating it because it illustrates my design. I'm using it because I don't know a better way to initialize the type. Thanks either way though