comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic.brenta@insalien.org>
Subject: Re: Dynamich Dispatching...
Date: Mon, 04 Oct 2004 23:01:55 +0200
Date: 2004-10-04T23:05:25+02:00	[thread overview]
Message-ID: <873c0uqjss.fsf@insalien.org> (raw)
In-Reply-To: Lz48d.2246$M05.992@newsread3.news.pas.earthlink.net

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.



  reply	other threads:[~2004-10-04 21:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-02 15:39 Dynamich Dispatching Rick Santa-Cruz
2004-10-03 17:11 ` Martin Krischik
2004-10-03 22:59   ` Brian May
2004-10-04  8:22     ` Martin Krischik
2004-10-03 18:56 ` Ludovic Brenta
2004-10-04  4:45   ` Jeffrey Carter
2004-10-04 21:01     ` Ludovic Brenta [this message]
2004-10-05  0:32       ` Jeffrey Carter
2004-10-04  8:02 ` Dmitry A. Kazakov
2004-10-04 11:02   ` Brian May
2004-10-04 12:50     ` Dmitry A. Kazakov
2004-10-15 18:27       ` Matthew Heaney
2004-10-16 19:25         ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox