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,104df2b9b7a2f689 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!koehntopp.de!news.bawue.net!news.belwue.de!LF.net!news.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: Interfaces Date: Mon, 16 May 2005 18:12:06 +0200 Message-ID: <87zmuv40bt.fsf@deneb.enyo.de> References: <8764xj9wzf.fsf@deneb.enyo.de> <4288c54b_2@news.arcor-ip.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: albireo.enyo.de 1116259929 25559 212.9.189.177 (16 May 2005 16:12:09 GMT) X-Complaints-To: Cancel-Lock: sha1:/Nw7kjQu75+LoLyokwXo4F9VK2Y= Xref: g2news1.google.com comp.lang.ada:11042 Date: 2005-05-16T18:12:06+02:00 List-Id: * Georg Bauhaus: > Florian Weimer wrote: > >> As far as I understand the Ada 200x spec, this subprogram declaration >> overrides both versions of Foo, such that >> Foo ((J1 (T_Obj)); >> Foo ((J2 (T_Obj)); >> invoke the same subprogram. > > IIUC, if J1 and J2 are interface types, then J1's Foo and J2's Foo > can only be abstract subprograms or null subprograms. If null > procedures, maybe they would be semantically the same anyway, > in a library. Sorry, maybe I should have expressed my thoughts more clearly. Library 1 provides a Do_Something procedure like: procedure Do_Something (Obj : in out J1; Param : String); Do_Something invokes Foo on Obj. Library 2 provides a completely different procedure, say Do_Another_Thing, which also invokes Foo: procedure Do_Another_Thing (Obj : J2; Result : out Natural); T wants to implement both J1 and J2, but can only provide a single implementation for Foo, which cannot suit both J1 and J2.