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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9fc9fc4716c48fb2,start X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!aioe.org!not-for-mail From: Dennis Hoppe Newsgroups: comp.lang.ada Subject: Interface specification in Ada Date: Wed, 11 Jun 2008 14:46:38 +0200 Organization: Aioe.org NNTP Server Message-ID: NNTP-Posting-Host: Op+/jjRScXQxxgs2D5OyfA.user.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) Xref: g2news1.google.com comp.lang.ada:644 Date: 2008-06-11T14:46:38+02:00 List-Id: Hi, my preferred programming language is Java and I'm used to declare in an interface some common methods, that all subclasses have to implement. For example: interface Bicycle { void changeCadence(int newValue); void changeGear(int newValue); void speedUp(int increment); void applyBrakes(int decrement); } class RacingBicycle implements Bicycle { // remainder of this class implemented as before } If I accidentially implement RacingBicycle without providing the four methods mentioned above, the compiler would draw attention to this situation. In Ada, i found the keyword "interface" only in the context of multiple inheritance. The usage would be: package Bicycle is type Object is interface; procedure changeCadence (newValue : in Integer) is abstract; procedure changeGear (newValue : in Integer) is abstract; procedure speedUp (increment : in Integer) is abstract; procedure applyBrakes (decrement : in Integer) is abstract; end Bicycle; with Bicycle; package RacingBicycle is type Object is new Bicycle.Object with null record; -- omitted needed procedures to raise an error end RacingBicycle; Unfortunately, the build process runs through without any errors. In this case, I want the compiler to notify me about missing procedure implementations, because they are declared abstract in the interface. I think, I missed something in the hierarchy, but I don't see it. Thank you in advance, Dennis Hoppe