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,f039470e8f537101 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-29 07:51:57 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!feed.news.nacamar.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: Non-philosophical definition of Eiffel? Date: Tue, 29 Jul 2003 16:56:35 +0200 Message-ID: <8tucivgbh5hkuicrpdeuavau8muf6a9mrh@4ax.com> References: <7u9Ua.13412$634.10307@nwrdny03.gnilink.net> <3F215120.1040706@attbi.com> <1059151910.357790@master.nyc.kbcfp.com> <1059416297.548253@master.nyc.kbcfp.com> <1059486223.780998@master.nyc.kbcfp.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: news.uni-berlin.de 1059490316 21911446 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:40953 Date: 2003-07-29T16:56:35+02:00 List-Id: On Tue, 29 Jul 2003 09:43:43 -0400, Hyman Rosen wrote: >Dmitry A. Kazakov wrote: >> How could it be otherwise? >> [If the argument type is contravariant, then the subroutine is not a >> method in this argument => it is not inherited.] > >It could be, in some other language. You could explicitly designate >which method was being overridden, and allow contravariant arguments. There is little sense in contravariant arguments, because they are too dangerous. Probably you mean class-wide arguments. But it is another case then. Anyway, the point is: you can only inherit through a covariant argument. >> That's not Effel's problem. This a problem of type specialization >> which inevitably breaks out-methods. Nothing can be done about it. > >You can disallow it! What? To disallow specialization? Carefully observe that already "const Thing" is a specialization and, how wonderful, it is not a LSP-subtype of Thing. Yet each and every language has an equivalent of const. Probably you want to disallow methods? Fine, but this also breaks LSP. In fact, anything reasonable would break LSP. Substitutability is kind of incompatible with reasonability. (:-)) > Eiffel's problem is that it allowed such things >without a good way of avoiding errors at the call sites, short of >whole-program verification or runtime type checks. You cannot map *all* substitutability semantics into [sub-]types. It does not work for many reasons. >> BTW, generalization breaks in-methods. In short, the notion of >> absolute substitutability (the way many are treating LSP) is useless >> absolutely. > >OO programming in its most mechanical sense involves derived classes >overriding base methods, and allowing those methods to be invoked by >things which know only the base. You can break that paradigm if you >want, but then you should probably call it something else, so you don't >confuse people. I would recommend you to read recent dicussions in comp.object concerning LSP. Actually there is always a new discussion each pair months. People like this idea. I would say, it is second popular to life-after-death. (:-)) --- Regards, Dmitry Kazakov www.dmitry-kazakov.de