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.107.149.140 with SMTP id x134mr21275058iod.65.1514377784358; Wed, 27 Dec 2017 04:29:44 -0800 (PST) X-Received: by 10.157.90.22 with SMTP id v22mr1090234oth.12.1514377784193; Wed, 27 Dec 2017 04:29:44 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.unit0.net!peer02.am4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!i6no2967693itb.0!news-out.google.com!b73ni11384ita.0!nntp.google.com!i6no2967692itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 27 Dec 2017 04:29:44 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.240.218.207; posting-account=rhqvKAoAAABpikMmPHJSZh4400BboHwT NNTP-Posting-Host: 85.240.218.207 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: use of 'Base to compensate for the lack of information From: Mehdi Saada <00120260a@gmail.com> Injection-Date: Wed, 27 Dec 2017 12:29:44 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Body-CRC: 3445149858 X-Received-Bytes: 2420 Xref: reader02.eternal-september.org comp.lang.ada:49650 Date: 2017-12-27T04:29:44-08:00 List-Id: To compensate for the lack of exercices, I rewrote part of the package prov= ided by the teacher. It sure allows a better understanding of what's going = on. And I purged the errors much faster than the first time. There are the p_poly package, who elaborate the operations on polynome, wit= hout knowing about the internal structure of the coefficients, whose type i= s defined is another generic package. P_poly is generic too, and take the needed methods of a private "ELEMENT" r= epresenting the coefficient as parameters, along with ELEMENT itself, who c= ould be a scalar, modular or whatever type instead of a record modelling ra= tionals. It seems good and practical, but at one time, I need the coefficient to be = multiplied by the coefficients' array index, which is a Natural. So, I wrote with function "*" (E1: in ELEMENT; E2: in NATURAL'Base) return ELEMENT = is <>; But since X'Base meant the unconstrained subtype of X, any type defined as = "type T is range ..." won't fit in. Yet I don't want any assumption on the = nature of ELEMENT. It could be defined as Integer, Natural, modular types, = or be rational made of modular types in case of FINITE FIELDS. How do I do while keeping that generic design ?