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,FREEMAIL_FROM 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-31 08:49:44 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!in.100proofnews.com!in.100proofnews.com!news2.euro.net!ash.uu.net!spool.news.uu.net!not-for-mail Date: Thu, 31 Jul 2003 11:49:43 -0400 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5a) Gecko/20030611 Thunderbird/0.1a X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Non-philosophical definition of Eiffel? References: <1059416297.548253@master.nyc.kbcfp.com> <1059486223.780998@master.nyc.kbcfp.com> <8tucivgbh5hkuicrpdeuavau8muf6a9mrh@4ax.com> <1059496557.747795@master.nyc.kbcfp.com> <1059583115.463164@master.nyc.kbcfp.com> <91nhivgoeparbpt1984prf1o09sos9f9p5@4ax.com> In-Reply-To: <91nhivgoeparbpt1984prf1o09sos9f9p5@4ax.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1059666583.748653@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@nightcrawler.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1059666583 23993 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:41082 Date: 2003-07-31T11:49:43-04:00 List-Id: Dmitry A. Kazakov wrote: > No it isn't. You forgot semantics. LSP is all about semantics. Maybe it is to you. To me, LSP is all about programming. I don't worry my head about pretty little semantic notions. > This problem appears each time a derived type is > a specialization of the base. In OO, derived types are supposed to be able to do whatever their base can do, and optionally more. If you want a derived type to do less, don't make it a (public) child of the Base. The formal expression of this in many OO languages is that the parameter types of overriding functions are the same as their base function parameter types. Now, it is true that many people use a technique of having a wide base interface, and then implementing derived methods which do nothing but throw exceptions. Contravariant parameter types could be looked at in the same way - as if the overriding function took the wider type, but immediately did a type test and threw an exception if the result was not of the narrower type. I don't happen to like this way of doing things, because I favor static polymorphism, but for some people, this floats their boat.