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: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 109fba,b87849933931bc93 X-Google-Attributes: gid109fba,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public X-Google-Thread: f43e6,b87849933931bc93 X-Google-Attributes: gidf43e6,public From: mam@melpar.esys.com (matthew mclellan) Subject: Re: OO, C++, and something much better! Date: 1997/01/28 Message-ID: <5cku3e$mjg@fcserv1.fcd.esys.com>#1/1 X-Deja-AN: 213389020 references: <5b1ais$oev@wdl1.wdl.lmco.com> <32D64F6C.37D3@trcinc.com> <32ECD5A8.7293@calfp.co.uk> followup-to: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object,comp.software-eng organization: E-Systems Falls Church Division newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object,comp.software-eng Date: 1997-01-28T00:00:00+00:00 List-Id: Nick Leaton (nickle@calfp.co.uk) wrote: : 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 What about deriving car_array from array, and overriding the sort method? Matt Raytheon E-Systems --The opinion(s) expressed above are mine, and not at all related to Raytheon E-Systems