inconsistent definition of "sort" (and what about stability?)



On 11/12/11, Raymond Toy <toy.raymond at gmail.com> wrote:

> On Nov 12, 2011 8:03 PM, "Steve Haflich" <smh at franz.com> wrote:

>> 1) Rewrite $sort to conform to the Maxima documentation, in a way that
>>   is portable to all ANSI-conformant implementations.
>>
>> 2) Rewrite the documentation to agree (other than the copy-list) with
>>   the ANSI definition.

Well, as it happens, I wrote the current version of the documentation
for "sort", in an attempt to get the documentation to conform to the code.
At this point I am inclined to adjust the documentation so that it
describes a useful, comprehensible function, and then adjust the
code so that it conforms to the documentation. I suspect that in
both cases the changes are minor.

>> 3) Ignore this minor discrepency for the time being, because more
>>   important issues require atention in Maxima source and documentation.

Nah. Fixing up "sort" is really no big deal. Now that it has come
to our attention, let's just go ahead and do it.

> (4) Use cl:stable-sort. (Perhaps that's what (1) is saying.)

As part of the revised "sort" description, I recommend very strongly
to say that "sort" is a stable sort. Incidentally, I am very strongly
opposed to having another version of "sort" which is not a stable sort.

FWIW

Robert Dodier