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=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R.Carter" Newsgroups: comp.lang.ada Subject: Re: Arrays with discriminated task components Date: Sat, 24 Dec 2022 23:41:34 +0100 Organization: A noiseless patient Spider Message-ID: References: <9b729cf0-02c7-48e1-8cea-c0d177c4bf3bn@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 24 Dec 2022 22:41:37 -0000 (UTC) Injection-Info: reader01.eternal-september.org; posting-host="030fb7bc385e68993db4e7309219bc3c"; logging-data="2510212"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Uw/G997Sn7wYEV1jp+m2+/tPbVm5tTz4=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Cancel-Lock: sha1:3ipaO6aFeAzWs9lmUNYBfBmIRp0= Content-Language: en-US In-Reply-To: Xref: reader01.eternal-september.org comp.lang.ada:64730 List-Id: On 2022-12-24 19:05, Niklas Holsti wrote: > On 2022-12-24 13:44, AdaMagica wrote: >> >> 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 => ???); > > One way is to give the discrimant a default value that is a function call that > returns a new identifier on each call: No, this does not guarantee that the task's discriminant is its index in the array, which is a requirement of the question. -- Jeff Carter "My mind is aglow with whirling, transient nodes of thought, careening through a cosmic vapor of invention." Blazing Saddles 85