[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: the discussion so far

Thomas Bushnell BSG scripsit:

> When you provide a function that does almost-the-right-thing, you are
> encouraging programmers to use it.  The only case where you have
> identified a value to this function (when implemented as a simple
> radix comparator on codepoints) is when you have binary search trees
> which you want to exchange between scheme systems.

I picked that as a counterexample to the claim that there were no such
use cases.

> Yet, this function will not be used only for that purpose.  Instead,
> it will be used just as the R5RS function is: a general purpose way of
> sorting strings to alphebetize them for human-readable output.  

Then document that it should not be used in that way.

> Any programmer, you see, who wants to write code that Does The Right
> Thing and uses this function, thinking, "oh, this will sort strings
> usefully for human readable output", will be wildly misled.  On their
> scheme system it will be fine, but then on a fancy enough scheme
> system, with full Unicode support, their code will break.
> It would have been better to tell them "Scheme has no portable way to
> sort strings for human-readable output" than to provide a function
> which is almost right.

I quite agree that such a disclaimer is very much in order; I note that
R5RS does not say that the procedures in question *can* be used for such
a purpose, and indeed they cannot reliably be so used.

John Cowan  jcowan@xxxxxxxxxxxxxxxxx  www.reutershealth.com  www.ccil.org/~cowan
The whole of Gaul is quartered into three halves.
        -- Julius Caesar