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=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.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: "too few element" in an unconstrained array, given as litteral ? Date: Sat, 20 Jan 2018 23:27:21 +0200 Organization: Tidorum Ltd Message-ID: References: <25736b03-e178-41ce-84fc-0e7da0e11420@googlegroups.com> <340b9df2-732e-4355-a85f-020e9f754a9b@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net PVp50tcC13yQqWx1jkcFJwvkdHhUTOhOjsGOYJUGLjARo023Mm Cancel-Lock: sha1:ZPwcicduhKvPIZ+wkpuQcFNlDy8= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: <340b9df2-732e-4355-a85f-020e9f754a9b@googlegroups.com> Xref: reader02.eternal-september.org comp.lang.ada:50031 Date: 2018-01-20T23:27:21+02:00 List-Id: On 18-01-20 18:52 , Mehdi Saada wrote: > We discussed it some weeks ago, > but how do I write: > Temp := (Poly_B.Degre + Ind - 1, (Poly_B.Degre + Ind - 1 => (1/1)), others => <>); (There seems to be a typo in the above: the second ')' should be at the end.) > Ind is the index of a for loop, hence there's a dynamic choice, hence ... > No other choices possible. So the above is illegal. Yes. > I want the nicest expression, because the algo part was already hard Assuming that Poly_B.Degre + Ind - 1 is the highest index ('Last) in the aggregate, you could concatenate two aggregates (the index used in the second, one-element concatenand is irrelevant, I chose 1 for brevity, see RM 4.5.3): Temp := ( Poly_B.Degre + Ind - 1, (0 .. Poly_B.Degre + Ind - 2 => <>) & (1 => (1/1))); That assumes also that the first index is zero. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .