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,6009c73a58f787a0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-17 07:30:52 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!news-feed1.de1.concert.net!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: dmitry@elros.cbb-automation.de (Dmitry A. Kazakov) Newsgroups: comp.lang.ada Subject: Re: How to avoid unreferenced objects (mutexes etc) Date: Thu, 17 Jan 2002 15:30:50 GMT Message-ID: <3c46e8aa.93415500@News.CIS.DFN.DE> References: <3c3ee8c8.105408250@News.CIS.DFN.DE> <3c429d1c.2624281@News.CIS.DFN.DE> <3c45865f.2709203@News.CIS.DFN.DE> <3c468b1a.69461281@News.CIS.DFN.DE> <3c46a853.76943187@News.CIS.DFN.DE> NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) X-Trace: fu-berlin.de 1011281451 32622582 212.79.194.111 (16 [77047]) X-Newsreader: Forte Free Agent 1.21/32.243 Xref: archiver1.google.com comp.lang.ada:19016 Date: 2002-01-17T15:30:50+00:00 List-Id: On Thu, 17 Jan 2002 10:55:57 +0000 (UTC), lutz@iks-jena.de (Lutz Donnerhacke) wrote: >* Dmitry A. Kazakov wrote: >>* lutz@iks-jena.de (Lutz Donnerhacke) wrote: >>>* Dmitry A. Kazakov wrote: >>>>I believe it is worth to allow that for all types, i.e. to allow >>>>overriding a non-abstract subroutine with an abstract one. A >>>>dispatching call to a disallowed subprogram will then raise an >>>>exception [like when tags of arguments are different]. >>> >>>I strongly discourage from such a change. Class wide programming using >>>abstract tagged types are used for the guarantee of a working interface. >> >>There is no way to enforce LSP, if you aim at that. Just consider an >>overriding like: >> >>procedure Do_Something (...) is >>begin >> raise Program_Error; >>end Do_Something; > >Then the reason is on client site. Which is easy to detect. How it differentiates from: procedure Do_Something (..) is abstract; The later has an additional advantage that some calls to it can be detected at compile time. Consider disallowing methods as an additional constraint. Any constraint imposed by a derived type is incompatible with LSP. Should we then dismiss the idiom of constrained subtypes? >>And who said that derived types shall be LSP subtypes? > >The generic preamble requiring the correct instantiation. You must define the word correct. If correct = absolutely substitutable then of course LSP is required. Regards, Dmitry Kazakov