Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!crd.ge.com From: meltsner@crd.ge.com (Kenneth J Meltsner) Newsgroups: comp.object Subject: Re: Objects and Interactions: Separate Definitions Message-ID: <19807@crdgw1.crd.ge.com> Date: 22 May 91 18:50:22 GMT References: <3999@motcsd.csd.mot.com> <1991May21.064913.16149@netcom.COM> <1991May22.012821.12048@tkou02.enet.dec.com> <1991May22.183044.5634@Think.COM> Sender: news@crdgw1.crd.ge.com Reply-To: meltsner@crd.ge.com Distribution: comp Organization: GE Research and Development Center Lines: 34 In article <1991May22.183044.5634@Think.COM>, barmar@think.com (Barry Margolin) writes: [...] |>The other way to solve it is where I think this discussion started: |>implement a class that represents the collection, and implement operations |>on the collection class that do all the different sorts. Thus, for a phone |>number database, there could be SORT-JAPANESE, SORT-WESTERN, and |>SORT-BY-NUMBER methods. A single SORT method doesn't really make sense, |>unless you want to unilaterally declare that one of these would be a |>reasonable default and have SORT simply call it. |> |>This parallels the real world. If someone hands you a stack of baseball |>cards and just tells you to sort it, you've got to guess what he means. He |>could want them sorted by player name, team, year, batting average, etc. |>There's no such thing as a generic sort or a generic comparison operator. I'd like to second this concept, if only for the difficulties we'll soon see with successors to ASCII which no longer support a simple arithmetic comparison of character code to sort. And for more complex issues, like sorting book names that include Roman numerals, spelled-out numbers, words to ignore (like initial "The"), etc. Check the Library of Congress book title sorting rules if you want an idea of how complex this is. -- =============================================================================== Ken Meltsner | meltsner@crd.ge.com (518) 387-6391 GE Research and Development Center | Fax: (518) 387-7495 P.O. Box 8, Room K1/MB207 | Nothing I say should be attributed Schenectady, NY 12301 | to my employer, and probably vice-versa =================Dep't of Materials Science, ACME Looniversity=================