comp.lang.ada
 help / color / mirror / Atom feed
From: Dmitry A. Kazakov <mailbox@dmitry-kazakov.de>
Subject: Re: A bunch of questions that come after "Hello world"
Date: Mon, 18 Nov 2002 12:54:58 +0100
Date: 2002-11-18T12:54:58+01:00	[thread overview]
Message-ID: <e2ihtu454lfirb4cp53b5fv9eb6vikffua@4ax.com> (raw)
In-Reply-To: 5ad0dd8a.0211180224.1895e8ea@posting.google.com

On 18 Nov 2002 02:24:46 -0800, wojtek@power.com.pl (Wojtek Narczynski)
wrote:

>Robert A Duff <bobduff@shell01.TheWorld.com> wrote in message news:<wcc7kfe8ma7.fsf@shell01.TheWorld.com>...
>
>> Part of the reason for these things is history.  Ada tasks were
>> originally just tasks -- there were no task types.  Similar to the way
>> packages are not "objects" -- there are no "package types".  This was
>> around 1980 or so.  Task types were added before the 1983 standard.
>> Protected types (added in Ada 95) were somewhat modeled after tasks,
>> and so inherited some of the oddities.
>
>Thanks for the explanation. I will have to keep the evolutionary
>nature of Ada syntax in mind.
>
>> Ada does not support multi-dispatch.  If you have two controlling
>> operands, they both have to have the same tag.
>
>What do you mean?
>
>procedure( X: Type1'Class; Y: Type2'Class);
>
>Compiles for me.

It is not the case. The case would be:

procedure Foo (X: Type1; Y: Type2);

Which will not compile. [An operation cannot be dispatching for two
different types.]  Your example does not dispatch, it is a class-wide
operation which is same for Type1, Type2 and all types derived from
them.

There is a more special case:

procedure Foo (X: Type1; Y: Type1);

This compiles and as long as the tags of X and Y are same works. If
they are not, Constraint_Error will propagate. One could call it
multiple dispatch, but then it is a very limited one.

---
Regards,
Dmitry Kazakov
www.dmitry-kazakov.de



  reply	other threads:[~2002-11-18 11:54 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-13 20:44 A bunch of questions that come after "Hello world" Wojtek Narczynski
2002-11-13 20:57 ` Robert A Duff
2002-11-14 10:18   ` Wojtek Narczynski
2002-11-14 11:21     ` David C. Hoos, Sr.
2002-11-14 19:51     ` tmoran
2002-11-14 21:51     ` Robert A Duff
2002-11-15 17:50       ` Wojtek Narczynski
2002-11-15 23:07         ` Robert A Duff
2002-11-18 10:24           ` Wojtek Narczynski
2002-11-18 11:54             ` Dmitry A. Kazakov [this message]
2002-11-18 16:24               ` Wojtek Narczynski
2002-11-18 21:19                 ` Robert A Duff
2002-11-19  8:48                 ` Dmitry A. Kazakov
2002-11-13 22:06 ` Martin Dowie
2002-11-14 17:48   ` Pascal Obry
2002-11-14 18:53     ` David C. Hoos
2002-11-14 22:36     ` Martin Dowie
2002-11-15  1:25       ` Jeffrey Carter
2002-11-13 22:31 ` Stephen Leake
  -- strict thread matches above, loose matches on Subject: below --
2002-11-18 10:32 Grein, Christoph
replies disabled

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