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.165.1 with SMTP id k1mr10692607itf.41.1513993635091; Fri, 22 Dec 2017 17:47:15 -0800 (PST) X-Received: by 10.157.12.185 with SMTP id b54mr712645otb.1.1513993634861; Fri, 22 Dec 2017 17:47:14 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!border2.nntp.ams1.giganews.com!nntp.giganews.com!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.am4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!g80no1678300itg.0!news-out.google.com!b73ni5385ita.0!nntp.google.com!i6no1674639itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 22 Dec 2017 17:47:14 -0800 (PST) In-Reply-To: <0d33e631-e63d-4346-ac95-5eec72127f4f@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.245.163.184; posting-account=rhqvKAoAAABpikMmPHJSZh4400BboHwT NNTP-Posting-Host: 85.245.163.184 References: <0d33e631-e63d-4346-ac95-5eec72127f4f@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0a42819a-9508-4094-b04b-b2b936c1435f@googlegroups.com> Subject: Re: syntaxic exploration From: Mehdi Saada <00120260a@gmail.com> Injection-Date: Sat, 23 Dec 2017 01:47:15 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Body-CRC: 2456681512 X-Received-Bytes: 2203 Xref: reader02.eternal-september.org comp.lang.ada:49599 Date: 2017-12-22T17:47:14-08:00 List-Id: Thank you, Niklas Holsti. Your way of doing it is just beautiful, as always with conditional expressions. Also, I simply forgot about the & operator for non-strings arrays. Still: p_poly_v1_g.adb:64:92: expected private type "T_Rationnel" defined at p_rationnels_g.ads:11, instance at p_poly_v1_g.ads:19 p_poly_v1_g.adb:64:92: found type universal integer p_poly_v1_g.adb:64:149: expected private type "T_Rationnel" defined at p_rationnels_g.ads:11, instance at p_poly_v1_g.ads:19 p_poly_v1_g.adb:64:149: found type universal integer gnatmake: "p_poly_v1_g.adb" compilation error with the same sentences as in your exemple. At least, I can't see the difference with what you wrote. return RES: T_POLYNOME (T_DEGRE'MAX(POLY_A.DEGRE,POLY_B.DEGRE)) do for I in RES.COEF'Range loop RES.COEF(I) := (if I in POLY_A.COEF'Range then POLY_A.COEF(I) else 0) + (if I in POLY_B.COEF'Range then POLY_B.COEF(I) else 0); end loop; RES := POLY_REDUIT(RES); end return;