From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.8 required=3.0 tests=BAYES_50,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:a37:eca:: with SMTP id 193mr1430721qko.261.1611590886062; Mon, 25 Jan 2021 08:08:06 -0800 (PST) X-Received: by 2002:a25:3056:: with SMTP id w83mr1558980ybw.504.1611590885859; Mon, 25 Jan 2021 08:08:05 -0800 (PST) Path: eternal-september.org!reader02.eternal-september.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 25 Jan 2021 08:08:05 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=87.143.127.6; posting-account=rHjQvgoAAACyPWm5s-bLXdFCueApAPxr NNTP-Posting-Host: 87.143.127.6 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Simple example on interfaces From: Mario Blunk Injection-Date: Mon, 25 Jan 2021 16:08:06 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:61193 List-Id: I'm trying to solve a problem of multiple inheritance. It seems to me that an interface could be the solution although the interface is still a mystery for me. This is the example code: https://github.com/Blunk-electronic/ada_training/blob/master/src/interfaces_1/interfaces_1.adb The problem to solve is: Type_A2 and type_B1 shall have the property p2 which is type_enum. The anchestors of type_A2 and type_B1 must not have this property. Both type_A2 and type_B1 shall inherit p2 from type_C so that p2 must not be written all over again. Would an interface be the solution ? Thanks for your help.