From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.8 required=3.0 tests=BAYES_50,FREEMAIL_FROM, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:ac8:4403:0:b0:3a7:f2b0:c4c0 with SMTP id j3-20020ac84403000000b003a7f2b0c4c0mr546084qtn.490.1671882268223; Sat, 24 Dec 2022 03:44:28 -0800 (PST) X-Received: by 2002:a05:620a:1fc:b0:6ee:bbea:1ebb with SMTP id x28-20020a05620a01fc00b006eebbea1ebbmr628246qkn.638.1671882268084; Sat, 24 Dec 2022 03:44:28 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 24 Dec 2022 03:44:27 -0800 (PST) Injection-Info: google-groups.googlegroups.com; posting-host=94.31.100.23; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf NNTP-Posting-Host: 94.31.100.23 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <9b729cf0-02c7-48e1-8cea-c0d177c4bf3bn@googlegroups.com> Subject: Arrays with discriminated task components From: AdaMagica Injection-Date: Sat, 24 Dec 2022 11:44:28 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 1594 Xref: reader01.eternal-september.org comp.lang.ada:64728 List-Id: I've got a task type with a discriminant: type Index is range 1 .. N; task type T (D: Index); Now I want an array of these tasks, where each task knows its identity (the index) via the discriminant, an iterated_component_association: Arr: array (Index) of T := (for I in Index => ???); How can I do this? This works with access, but I find this extremely ugly: Arr: array (Index) of access T := (for I in Index => new T (I)); Alternatively, I could use the traditional method with a Start entry with the index as parameter: task type T is entry Start (D: Index); end T;