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-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!colt.net!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!newspeer1.se.telia.net!newspeer3.se.telia.net!se.telia.net!fi.sn.net!newsfeed2.tdcnet.fi!news.song.fi!not-for-mail Date: Fri, 20 Nov 2009 16:19:57 +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: <4b06a5b3$0$3842$4f793bc4@news.tdc.fi> NNTP-Posting-Host: 81.17.205.61 X-Trace: 1258726835 news.tdc.fi 3842 81.17.205.61:54273 X-Complaints-To: abuse@tdcnet.fi Xref: g2news1.google.com comp.lang.ada:8175 Date: 2009-11-20T16:19:57+02:00 List-Id: Markus Schoepflin wrote: > 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? >> > > And one more question, can I have a dispatching procedure that doesn't > explicitly use the type it dispatches on? No, as there is no implicit "this" parameter in Ada (and no syntactic brackets to group all the operations of a type). To make an operation overridable (a "primitive operation" in Ada terms) you have to include one or more parameters of the type (or of "access" to the type) or it must return a value of the type (or "access" to the type). And moreover the operation must be declared in the same package declaration as the type. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .