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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b4731a3b5d591abd X-Google-Attributes: gid103376,public From: Mats Weber Subject: Re: Task Discriminants & Arrays Date: 1997/05/15 Message-ID: <337AE917.814@elca-matrix.ch>#1/1 X-Deja-AN: 241679536 References: <3379C86F.352@this.message> Organization: ELCA Matrix SA Reply-To: Mats.Weber@elca-matrix.ch Newsgroups: comp.lang.ada Date: 1997-05-15T00:00:00+00:00 List-Id: W. Wesley Groleau (Wes) wrote: > -- write Bob Duff's ID function to ensure that all IDs are in A'Range > -- instantiate your favorite sort with the "<" above and Matt's array. > -- declare the array, then sort it. > -- result: A(I).ID = I for all I in A'Range You can't sort it because task types are limited and you can't move them in the array (no assignment). So you have to use access types and thus allocate the tasks one by one, or sort an array of pointers that point to the original array, which messes up the program quite a bit.