[r6rs-discuss] [Formal] Add (sort) and (vector-sort!) procedures

From: Marcin 'Qrczak' Kowalczyk <qrczak>
Date: Tue Oct 3 18:38:17 2006

Sven.Hartrumpf_at_FernUni-Hagen.de writes:

> If some people are really interested in this they should revive SRFI-32,
> which has been withdrawn at a - let's say - 90% completion level.

I can't believe that R6RS needs 28 procedures about sorting.
I propose four:

   (sort lst <)
   (sort-by lst get-key <)
   (vector-sort! vec <)
   (vector-sort-by! vec get-key <)

All stable, with the algorithm unspecified (recommended N*log(N)
complexity). The "!" variants sort in place. The key should be
extracted exactly once for each element.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak_at_knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/
Received on Tue Oct 03 2006 - 18:38:03 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC