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.155.75 with SMTP id d72mr10534803ioe.31.1518470317298; Mon, 12 Feb 2018 13:18:37 -0800 (PST) X-Received: by 10.157.95.135 with SMTP id g7mr489482oti.14.1518470317053; Mon, 12 Feb 2018 13:18:37 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!o66no1110069ita.0!news-out.google.com!m16ni2557itm.0!nntp.google.com!o66no1110067ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 12 Feb 2018 13:18:36 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=82.154.189.221; posting-account=rhqvKAoAAABpikMmPHJSZh4400BboHwT NNTP-Posting-Host: 82.154.189.221 References: <634e9064-33f8-42c0-9032-e630f98c89d4@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <982639bc-8e7e-4c43-a1ff-cf9fa7c0d0ed@googlegroups.com> Subject: Re: troubles learning OOP: expected type "Parent.Some_Child", found type Parent'Class From: Mehdi Saada <00120260a@gmail.com> Injection-Date: Mon, 12 Feb 2018 21:18:37 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:50397 Date: 2018-02-12T13:18:36-08:00 List-Id: the components are all enumeration types of one character, except for T_TOK= EN_OPERANDE.OPERANDE who's an INTEGER. Ahhh... The trick is to encapsulate the components of different types into = tagged types, so that they can be grouped together into a class, and so GET= _ELEM can be dispatched. That's awfully artifical. Unfortunately, I must ke= ep with the current design, with things like type T_TOKEN is abstract tagged null record; type T_TOKEN_OPERANDE is new T_TOKEN with record OPERANDE: INTEGER; end record; Besides, I still would need to access the actual inner component of Somethi= ng, not only OPERANDE_SOMETHING. Even I'm wrong I can't apply that anyway. I can't believe T_TOKEN'class is as useless... well, in a sense, since the = program doesn't know the actual type of TOKEN but only that it's a child of= T_TOKEN, no wonder there's some limitations. But I'm surprised there's no = mechanism in the language, to tell the program: HEY there ! I'm sure it's T= _TOKEN_OPERANDE, so now consider TOKEN as such and let me reach it's OPERAN= DE component.