<div>Could you people have a look at the bug report and my answer? I believe I am right, though SBCL is reporting a different order and this (once more) confuses users</div><div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">
<div><br></div><p><strong>bugs:206 string-lessp does not behave as string< ignoring case</strong></p><p><strong>Status:</strong> open <strong>Created:</strong> Thu Sep 20, 2012 09:43 PM UTC by Rafael Jesús Alcántara Pérez <strong>Last Updated:</strong> Thu Sep 20, 2012 09:43 PM UTC <strong>Owner:</strong> nobody</p>
<p>Ignoring case, this two function calls should behave the same («string-lessp and string-greaterp are exactly like string< and string>, respectively, except that distinctions between uppercase and lowercase letters are ignored. It is as if char-lessp were used instead of char< for comparing characters.»):</p>
<div><pre>(string< "a_" "aa") => 1</pre></div><div><pre>(string-lessp "a_" "aa") => nil</pre></div><p>But this is not the case. Am I missing something?</p></blockquote></div>
<div><br></div><div>STRING-LESSP is indeed implemented using CHAR-LESSP but your expectations about how this function should behave are wrong. Note that the Common Lisp standard states that CHAR-LESSP ignores case but it must do so not only when both characters are alphabetic, but also when comparing alphabetic and non-alphabetic ones.</div>
<div><br></div><div>An ordering must be transitive (A < B) and (B < X) must imply (A < X). Take for instance #\_, #\a and #\A. We have (< #\A #\_ #\a) Now you only want (CHAR-LESSP #\A #\a) to change value but this destroys transitivity.</div>
<div><br></div><div>The only way to achieve this with CHAR-LESSP is to convert the character first to one case and then perform the comparison, which is what has been done for a long time with Common Lisps.</div><br clear="all">
<div><br></div>-- <br>Instituto de Física Fundamental, CSIC<br>c/ Serrano, 113b, Madrid 28006 (Spain) <br><a href="http://juanjose.garciaripoll.googlepages.com" target="_blank">http://juanjose.garciaripoll.googlepages.com</a><br>