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,4a5bab72e3ac47fc X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!newsgate.cistron.nl!transit.news.xs4all.nl!195.241.76.212.MISMATCH!tiscali!transit1.news.tiscali.nl!dreader2.news.tiscali.nl!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Dynamich Dispatching... References: <87zn33r5pq.fsf@insalien.org> From: Ludovic Brenta Date: Mon, 04 Oct 2004 23:01:55 +0200 Message-ID: <873c0uqjss.fsf@insalien.org> User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:otaVPvRybShG4g/zBCqbflJh1SQ= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Tiscali bv NNTP-Posting-Date: 04 Oct 2004 23:05:25 CEST NNTP-Posting-Host: 83.134.238.139 X-Trace: 1096923925 dreader2.news.tiscali.nl 44103 83.134.238.139:37778 X-Complaints-To: abuse@tiscali.nl Xref: g2news1.google.com comp.lang.ada:4676 Date: 2004-10-04T23:05:25+02:00 List-Id: Jeffrey Carter writes: > Ludovic Brenta wrote: > >> package Objects is >> type Object is tagged private; >> procedure Draw (O : in Object); -- a primitive suprogram >> procedure Draw_Any (O : in Object'Class); -- not a primitive > > Draw_Any is unnecessary. Draw may be called with any type in > Object'Class. Yes, I know, but this thread is about dynamic dispatching. If I write: with Circles; procedure Main C : Circles.Circle; begin Draw (C); end Main; this is static dispatching since the type of C is known at compile time, and no 'Class was ever used. Incidentally, for those not aware of it, Ada has a pragma Restriction (No_Dispatch) which makes 'Class illegal or just this reason (RM H.4(19)). -- Ludovic Brenta.