From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!news2.kpn.net!news.kpn.net!nslave.kpnqwest.net!nloc.kpnqwest.net!nmaster.kpnqwest.net!nreader3.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.lisp Subject: Re: Beginner question: performance problems with a simple program References: <36sW7.19$Mv6.41773@burlma1-snr2> <43d1o39e4.fsf@beta.franz.com> Mail-Copies-To: never From: Erik Naggum Message-ID: <3219063429863038@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 40 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 03 Jan 2002 16:17:12 GMT X-Complaints-To: newsmaster@KPNQwest.no X-Trace: nreader3.kpnqwest.net 1010074632 193.71.66.49 (Thu, 03 Jan 2002 17:17:12 MET) NNTP-Posting-Date: Thu, 03 Jan 2002 17:17:12 MET Xref: archiver1.google.com comp.lang.lisp:23556 * Aleksandr Skobelev | So, any non-English string won't be compared correctly? _Please_ try to understand there is no _one_ correct way to compare strings. Monoculturalism is simply wrong. That is why one chooses technical specifications that have arbitrary, but very predictable results. Making string< attempt to do culturally sensitive string comparisons would _always_ be wrong, because it is not specified to do that, was never intended to do that, and should never be intended or specified to do that if language designers do their job. The only reasonable way to do string< is to do it with repeated char<, which can only be done as < on char-code of the two characters (in practice, with machine less-than operations on the internal representation of the character object). In Common Lisp, that is precisely what it does. The only _correct_ way to do culturally sensitive sorting is to maintain a collation information string in addition to the "data" string. If you are unwilling to do this work, whoever employed you should get a refund, and if you did not know, whoever you paid for your education should be prepared to give you a refund, unless he demonstrated that you failed to do what you were told. So here is a hint: If you want to compare two strings with culturally sensitive contents, you need to know: which language both are in, how to convert strings of that language into collation information strings, and then compare the result with string<. Do _not_ try to roll this into one function or make assumptions about the language in use. And _please_ note that string< does not work for English, either. English is _not_ spelled correctly only using ASCII. Why are you behaving as if you are _envious_ of the fact that Common Lisp happened to be defined in the United States? Nobody forces you to use the functions that do not fill your needs. Please quit making it anybody else's problems -- just go implement what you think is right. (Whether you share it with others afterwards is not for me to suggest, but if you are concerned with the proper sorting of your natural language, it would seem reasonable to expect you to publish it, for pay or not.) /// --