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: a07f3367d7,366b213c4abb1039 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!goblin1!goblin2!goblin.stu.neva.ru!feeder.erje.net!195.197.54.118.MISMATCH!feeder2.news.elisa.fi!newsfeed2.funet.fi!newsfeed3.funet.fi!newsfeeds.funet.fi!fi.sn.net!newsfeed2.tdcnet.fi!news.song.fi!not-for-mail Date: Fri, 20 Nov 2009 16:00:08 +0200 From: Niklas Holsti Organization: Tidorum Ltd User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: What makes a procedure call 'dispatching' in Ada? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4b06a10e$0$26312$4f793bc4@news.tdc.fi> NNTP-Posting-Host: 81.17.205.61 X-Trace: 1258725646 news.tdc.fi 26312 81.17.205.61:52061 X-Complaints-To: abuse@tdcnet.fi Xref: g2news1.google.com comp.lang.ada:8172 Date: 2009-11-20T16:00:08+02:00 List-Id: Markus Schoepflin wrote: > Dmitry A. Kazakov wrote: > > [...] > > Thanks for you swift and helpful reply. > >> If P is to be defined in terms of any type from the class FOO, then P has >> to be declared differently (class-wide): > > So If I understand this correctly, if I want dispatching to happen on a > given type, I always need to use the class type? Yes. You can do that either by Dmitry's method, declaring the parameter as FOO'Class, or by converting a FOO parameter to FOO'Class for the call. But note that if an operation has no parameters (and no return value) of type FOO (or access FOO), only of FOO'Class, it is not a primitive operation of FOO and cannot be overridden in derived types. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .