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.53.71 with SMTP id c68mr10442935ioa.117.1518470351306; Mon, 12 Feb 2018 13:19:11 -0800 (PST) X-Received: by 10.157.63.152 with SMTP id r24mr487887otc.0.1518470351125; Mon, 12 Feb 2018 13:19:11 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!nntp.giganews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!w142no1115449ita.0!news-out.google.com!m16ni2536itm.0!nntp.google.com!w142no1115446ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 12 Feb 2018 13:19:10 -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: <43fd90b9-aa93-49b7-9ea2-95da53983d41@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:19:11 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Body-CRC: 3030402186 X-Received-Bytes: 2517 Xref: reader02.eternal-september.org comp.lang.ada:50398 Date: 2018-02-12T13:19:10-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.