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,ab66185f2bca0483 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-15 04:12:40 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Extension of non-limited type needs limited component Date: Fri, 15 Nov 2002 13:12:38 +0100 Message-ID: References: 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 1037362359 15407561 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:30936 Date: 2002-11-15T13:12:38+01:00 List-Id: On Fri, 15 Nov 2002 11:47:49 +0100 (MET), "Grein, Christoph" wrote: >> >This is not SmallTalk, where you can dispatch to a method that does not >> >exist. >> >> Sure? And what about this: >> >> type A is tagged ... >> procedure Foo (L, R : A); >> >> type B is new A with .... >> >> X : A'Class := Some_A; >> Y : A'Class := Some_B; >> >> Foo (X, Y); -- Oops, dispatching to nowhere! > >Either compiler catches this and does not compile. >Or during runtime, tag check is performed and will raise Constraint_Error. > >No dispatching to nowhere! Of course. Under dispatching to nowhere I just meant dispatching to a non-existing method: Foo (L : A; R: B); Both Ada and SmallTalk [AFAIK] do not crash when such thing happens. But this is not the problem. The problem is that though one could wish to detect all such and similar cases at compile time, one cannot. This does not mean that we should drop compile-time checks. [To put it clear, Ada is right, SmallTalk is wrong! (:-))] It only means that the argument, "this is not allowed, because it cannot be fully checked at compile time" is wrong. Alas, there are many damn useful things uncheckable at compile time. --- Regards, Dmitry Kazakov www.dmitry-kazakov.de