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.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FROM_STARTS_WITH_NUMS autolearn=no autolearn_force=no version=3.4.4 X-Received: by 10.36.74.5 with SMTP id k5mr490378itb.30.1516404201548; Fri, 19 Jan 2018 15:23:21 -0800 (PST) X-Received: by 10.157.32.68 with SMTP id n62mr4107ota.6.1516404201351; Fri, 19 Jan 2018 15:23:21 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.linkpendium.com!news.linkpendium.com!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!w142no874805ita.0!news-out.google.com!b73ni2816ita.0!nntp.google.com!w142no874800ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 19 Jan 2018 15:23:21 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.243.127.62; posting-account=rhqvKAoAAABpikMmPHJSZh4400BboHwT NNTP-Posting-Host: 85.243.127.62 References: <310b1dea-459b-4a8b-b249-5bb63ea43512@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <9a061f97-7d4e-4dfc-9581-2fd3768a08ec@googlegroups.com> Subject: Re: On naming space and the good use of qualified expression From: Mehdi Saada <00120260a@gmail.com> Injection-Date: Fri, 19 Jan 2018 23:23:21 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:50013 Date: 2018-01-19T15:23:21-08:00 List-Id: There's DEFINITELY something fishy here: Result.Coef(Ind) :=3D P_Rationals."/"((Ind+1),1); gave the same result: p_poly_v1_g.adb:82:42: expected private type "T_Rational" defined at p_rati= onals_g.ads:11, instance at p_poly_v1_g.ads:19 p_poly_v1_g.adb:82:42: found type "Standard.Integer" gnatmake: "p_poly_v1_g.adb" compilation error Then, I had the idea of renaming P_Rationals."/", which solves a bit of the= ambiguity, pointing at the fact that: type T_Entier is range <>; subtype T_Entier_Pos is T_Entier range 1..T_Entier'Last; subtype T_Degre is Natural range 0..Max; Ding Dong !! Found it ! Indeed, rational operators are defined for T_Entier= , in the P_Rational package. I then merely changed the definitions by: Max : Positive; Max_Degre: T_Entier :=3D T_Entier(Max); subtype T_Degre is T_Entier range 0..Max_Degre; It works now. Ah, I feel smart now. Every little thing Ada does is magic.. = Thanks to the idea of renaming "/", which gave me the supplement of informa= tions I needed to figure things out. Also, I forgot I had the operator function "*"(R1 : T_Rationnel; R2 : T_Entier) return T_Rationnel; which removes the need of using the construct. AdaMagica: 1)went on your website, love your humor. I think I'll begin drea= ming of Lady Ada, and probably her infamous father too. 2) Specifications a= re part of the exercice, I can't change it too much or use an already made = package, which would, well, negate the entire aim of the exercice :-P