comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada 2005?
Date: Tue, 28 Dec 2004 10:56:23 +0100
Date: 2004-12-28T10:56:23+01:00	[thread overview]
Message-ID: <1xxsp54fh2js2.1layknsasshu4.dlg@40tude.net> (raw)
In-Reply-To: cqq04b$gnf$1@a1-hrz.uni-duisburg.de

On Mon, 27 Dec 2004 21:51:07 +0000 (UTC), Georg Bauhaus wrote:

> Dmitry A. Kazakov <mailbox@dmitry-kazakov.de> wrote:
>: Nope, in Ada it is the equivalent of "method is final and defined to raise
>: Constraint_Error". It is a fundamentally different case.
> 
> What is the fundament, then?

The difference between:

case X is  -- Statically checkable
   when A =>
   when B =>
   when C => raise Constraint_Error;
end case;

and

case Y is  -- Dynamically checkable, when Y isn't constrained
   when A =>
   when B =>
   when others => raise Constraint_Error;
end case;

In Ada all choices are statically known. The only problem is that you
cannot override non-diagonal elements of the dispatch table. I suppose that
my opponent had a dim impression that the table might be unconstrained.
This is irrelevant. The trick is that you do not need to know the whole
table. At a deriving point only its submatrix for the base types of the
given one is of interest. In Ada that submatrix is statically known. This
is what I call "proper design" (and a advantage of static typing, BTW).

>:>>> Ah, so you define it away.
> 
> Or invent a new one?

Where is any other?

>:>>> MD = "Multiple Dispatch" in the orignal
>:>>> context of this thread which is /= more than one dispatching
>:>>> parameter.  This should be obvious.  Ada does not have MD, to argue
>:>>> otherwise just makes you look silly.
>:>> 
>:>> Care to give another definition of MD?
>:> 
>:> No, the original, as I noted here was and is the one under discussion
>:> and it is quite proper.
>: 
>: OK, I'll make it easier for you:
>: 
>: MD /= number of controlling parameters > 1 <=>
>: 1) Exists MD with 1 or 0 controlling parameters; or
>: 2) Dispatching subroutine with n>1 controlling parameters is not MD, but
>: SD, not D.
> 
> This is a mathematical trick, at best?

Trick? What is wrong with above, mathematics or just me? (:-))

> Obviously, "more than" in the above sentence isn't only about counting the
> number of parameters.  You could equally well say that Ada templates
> are recursive because they are when you limit the recursion depth to 0.
> 
> What did the makers of GNAT think when they invented the error message,
> 
>  "operation can be dispatching in only one type"?

Exactly what it tells: no dispatch on distinct types. MD /= dispatch in
distinct type hierarchies. Otherwise, infix dispatching operations were not
MD. See (2) above.
 
> So at the very least there must exists a notion of MD that isn't
> available with Ada.

Right. "Ada has MD" = "Ada has some cases of MD". It does not mean that Ada
has full or proper MD. It all started when my opponent disagreed with a
trivial statement: "... it (Ada's MD) is very limited and cannot be counted
as true multiple dispatch".

The problem with Ada 95 design is that there cannot be any consistent way
to avoid MD. C++ tries with awful results. Ada goes the same, though more
carefully. It defines freezing rules to prevent method declarations on
distinct types. But that is an easy part. What to do with MD within the
same type hierarchy? Nothing, MD creeps in. Differently to MI, you cannot
stopple all holes. Now (in Ada 2005) we'll have MI (called "interfaces" to
not to tease the geese (:-)). Let's see.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2004-12-28  9:56 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-18  4:27 Ada 2005? conradwt
2004-12-18  8:08 ` Martin Dowie
2004-12-20 20:06   ` conradwt
2004-12-21  6:51     ` Martin Dowie
2004-12-18  8:47 ` christov
2004-12-19  3:28   ` Randy Brukardt
2004-12-19 19:11     ` christov
2004-12-19 22:07       ` Ada User Journal (was: Re: Ada 2005?) Dirk Craeynest
2004-12-19 22:34         ` Ada User Journal Florian Weimer
2004-12-20  9:19           ` Martin Krischik
2004-12-20 11:02             ` Florian Weimer
2004-12-20 12:22               ` Thomas Hühn
2004-12-27 13:16                 ` Florian Weimer
2004-12-21  0:15   ` Ada 2005? David Botton
2004-12-18  8:51 ` Martin Krischik
2004-12-18 16:03 ` Dmitry A. Kazakov
2004-12-20 18:49   ` conradwt
2004-12-20 20:10     ` Dmitry A. Kazakov
2004-12-20 23:44       ` jayessay
2004-12-21  1:26         ` Alexander E. Kopilovich
2004-12-21  8:31           ` Dmitry A. Kazakov
2004-12-21 17:24           ` jayessay
2004-12-21  8:11         ` Dmitry A. Kazakov
2004-12-21 17:10           ` jayessay
2004-12-21 17:12             ` Dmitry A. Kazakov
2004-12-21 21:42               ` jayessay
2004-12-22  8:55                 ` Dmitry A. Kazakov
2004-12-22 18:02                   ` jayessay
2004-12-22 19:10                     ` Dmitry A. Kazakov
2004-12-23 18:09                       ` jayessay
2004-12-24  9:41                         ` Dmitry A. Kazakov
2004-12-27 17:09                           ` jayessay
2004-12-27 19:44                             ` Dmitry A. Kazakov
2004-12-27 21:51                               ` Georg Bauhaus
2004-12-28  9:56                                 ` Dmitry A. Kazakov [this message]
2004-12-28 17:56                                   ` jayessay
2004-12-28 17:48                                 ` jayessay
2004-12-28 17:36                               ` jayessay
2004-12-21  8:33     ` Martin Krischik
2004-12-21 15:34       ` jimmaureenrogers
2004-12-21 15:53         ` Martin Krischik
2004-12-22  9:34           ` Larry Kilgallen
2004-12-22 11:01             ` Martin Krischik
2004-12-22 12:52               ` Larry Kilgallen
2004-12-22 16:38                 ` Martin Krischik
2004-12-23 23:05       ` conradwt
2004-12-24  9:24         ` Pascal Obry
2004-12-24  9:59         ` Martin Krischik
2004-12-18 19:31 ` Jeffrey Carter
2004-12-20 18:55   ` conradwt
2004-12-20 23:53     ` Jeffrey Carter
2004-12-21  0:25       ` David Botton
2004-12-19  3:16 ` Brian May
2004-12-20 23:38   ` jayessay
2004-12-21 21:42     ` Brian May
replies disabled

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