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!news.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Arrays with discriminated task components Date: Sun, 25 Dec 2022 17:32:43 +0200 Organization: Tidorum Ltd 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 X-Trace: individual.net /uLGqva8V/PdJzORDgFYZAx1lUYexTxLR4HACgHxQ9HqqqpV5y Cancel-Lock: sha1:TYiTmL9ph4F74XIbRTZ09YoAgpM= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Content-Language: en-US In-Reply-To: Xref: reader01.eternal-september.org comp.lang.ada:64731 List-Id: On 2022-12-25 0:41, Jeffrey R.Carter wrote: > 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. Right, I did not take that requirement into account, apologies for my inattention. Indeed the tasks in the array are initialized in an arbitrary order, not necessarily in increasing index order.