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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5ac1c1813029999b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-18 03:55:00 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!syros.belnet.be!news.belnet.be!colt.net!peernews3.colt.net!news0.de.colt.net!news-fra1.dfn.de!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: A bunch of questions that come after "Hello world" Date: Mon, 18 Nov 2002 12:54:58 +0100 Message-ID: References: <5ad0dd8a.0211131244.42603699@posting.google.com> <5ad0dd8a.0211140218.6d48be15@posting.google.com> <5ad0dd8a.0211150950.4d550163@posting.google.com> <5ad0dd8a.0211180224.1895e8ea@posting.google.com> NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1037620499 17382430 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:31035 Date: 2002-11-18T12:54:58+01:00 List-Id: On 18 Nov 2002 02:24:46 -0800, wojtek@power.com.pl (Wojtek Narczynski) wrote: >Robert A Duff wrote in message news:... > >> 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