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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,b87849933931bc93 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public X-Google-Thread: f43e6,b87849933931bc93 X-Google-Attributes: gidf43e6,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public From: Nick Leaton Subject: Re: OO, C++, and something much better! Date: 1997/01/27 Message-ID: <32ECD5A8.7293@calfp.co.uk>#1/1 X-Deja-AN: 212550810 x-nntp-posting-host: calfp.demon.co.uk references: <5b1ais$oev@wdl1.wdl.lmco.com> <32D64F6C.37D3@trcinc.com> content-type: text/plain; charset=us-ascii mime-version: 1.0 newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object,comp.software-eng x-mailer: Mozilla 3.0Gold (X11; I; SunOS 5.5 sun4m) Date: 1997-01-27T00:00:00+00:00 List-Id: Roy Phillips wrote: > ... More problematical is > the > accidental substitution, for example of an operation with same name but > an > entirely differant meaning (for example, the terms 'interest' (financial > domain) and 'interest' (marketing domain)) - blame the English language > if > you will, but without semantic specification (i.e., Eiffel assertions) > the > whole thing is a can of worms. > If we take two classes, car and array. We have an array of cars and car is comparable. We can then have a sort implemented in array and sort cars. But if we wish to sort cars by size or price, then it becomes a little more difficult. You have two meanings to comparable for a car. Personally, I'm not sure of the best way to approach this problem but I suspect it would involve a sorter class, with price_sorter and size_sorter classes derived from the base class sorter. -- Nick