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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.36.225.7 with SMTP id n7mr367801ith.55.1518508838626; Tue, 13 Feb 2018 00:00:38 -0800 (PST) X-Received: by 10.157.63.152 with SMTP id r24mr13044otc.0.1518508838362; Tue, 13 Feb 2018 00:00:38 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.unit0.net!peer03.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!o66no1259278ita.0!news-out.google.com!s63ni3078itb.0!nntp.google.com!o66no1259275ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 13 Feb 2018 00:00:38 -0800 (PST) In-Reply-To: <982639bc-8e7e-4c43-a1ff-cf9fa7c0d0ed@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=76.218.37.33; posting-account=W2gdXQoAAADxIuhBWhPFjUps3wUp4RhQ NNTP-Posting-Host: 76.218.37.33 References: <634e9064-33f8-42c0-9032-e630f98c89d4@googlegroups.com> <982639bc-8e7e-4c43-a1ff-cf9fa7c0d0ed@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: troubles learning OOP: expected type "Parent.Some_Child", found type Parent'Class From: Stephen Leake Injection-Date: Tue, 13 Feb 2018 08:00:38 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 2222 X-Received-Body-CRC: 2526887383 Xref: reader02.eternal-september.org comp.lang.ada:50410 Date: 2018-02-13T00:00:38-08:00 List-Id: On Monday, February 12, 2018 at 3:18:38 PM UTC-6, Mehdi Saada wrote: > the components are all enumeration types of one character, except for T_TOKEN_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 keep 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; In addition, as Simon pointed out, Get_Elem must be a "primitive operation" of T_Token, and overridden for T_Token_Operande, so it will dispatch on a class-wide object.