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!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Why in (array) aggregate, no more component allowed after a dynamic choice ? Date: Mon, 22 Jan 2018 18:57:47 -0600 Organization: JSA Research & Innovation Message-ID: References: <25736b03-e178-41ce-84fc-0e7da0e11420@googlegroups.com> Injection-Date: Tue, 23 Jan 2018 00:57:47 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="3565"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:50059 Date: 2018-01-22T18:57:47-06:00 List-Id: It's complicated both for the reader and the compiler to ensure that an aggregate with multiple dynamic components in fact covers all of the components of the target type. (And that check is a hallmark of Ada, one cannot accidentally forget to specify a component and still have a working program.) It also gets very complicated to generate an others clause if a number of components at unknown locations are previously initialized. Ada probably could have allowed two such components or maybe even three without the complexity growing too much. But there is a standard language design axiom that one should allow either zero, one, or unlimited/many of any thing. Allowing more than one dynamic component would violate this axiom, and the limit it is rarely encountered (you seem to have a knack for running into language corner-cases :-). Randy. "Mehdi Saada" <00120260a@gmail.com> wrote in message news:aa4f3429-4bfd-44ac-a817-9fd0dd187841@googlegroups.com... >I had to write > declare > Temp: T_Polynome (Poly_B.Degre + Ind -1); > begin > Temp.Coef(Poly_B.Degre + Ind -1) := > Poly_A.Coef(Poly_B.Degre+Ind)/Poly_B.Coef(Poly_B.Degre); > end; > > Ind being a loop indice. > > whereas I would have prefered: > Temp: T_polynome := (Poly_B.Degre + Ind - 1,(Poly_B.Degre + Ind - 1 => > Poly_A.Coef (Poly_B.Degre+Ind)/Poly_B.Coef(Poly_B.Degre), others => <>)); > > What's the reason behind this limitation, whereas in one more sentence, > the same effect is achieved ?