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,131f06967722ab4b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada 2005? Date: Tue, 28 Dec 2004 10:56:23 +0100 Organization: cbb software GmbH Message-ID: <1xxsp54fh2js2.1layknsasshu4.dlg@40tude.net> References: <1103344064.372396.51420@c13g2000cwb.googlegroups.com> <1vj2pp9437gal.1b1lyqe3o973k$.dlg@40tude.net> <1ttqv5msigzua$.12l6jurw2zmd6$.dlg@40tude.net> <1j02qdx8hrd7o.1d5se652uerrr$.dlg@40tude.net> <1myqjpkliibqc$.qwe4gdpt4pi0.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: individual.net NY+U5z1E9Rjz6Y5B1zllzQJE/6nqvAeQ5jZR41E2bf17DH0bE= User-Agent: 40tude_Dialog/2.0.12.1 Xref: g2news1.google.com comp.lang.ada:7243 Date: 2004-12-28T10:56:23+01:00 List-Id: On Mon, 27 Dec 2004 21:51:07 +0000 (UTC), Georg Bauhaus wrote: > Dmitry A. Kazakov 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