Debian Codegraph @

%3a132/sort.scm

raw symbols SCIP
1 ;;; The sort package -- general sort & merge procedures
2 ;;;
3 ;;; Copyright (c) 1998 by Olin Shivers.
4 ;;; You may do as you please with this code, as long as you do not delete this
5 ;;; notice or hold me responsible for any outcome related to its use.
6 ;;; Olin Shivers 10/98.
7
8 ;;; This file just defines the general sort API in terms of some
9 ;;; algorithm-specific calls.
10
11 (define (list-sort < l) ; Sort lists by converting to
12 (let ((v (list->vector l))) ; a vector and sorting that.
13 (vector-heap-sort! < v)
14 (vector->list v)))
15
16 (define list-sort! list-merge-sort!)
17
18 (define list-stable-sort list-merge-sort)
19 (define list-stable-sort! list-merge-sort!)
20
21 (define vector-sort vector-quick-sort)
22 (define vector-sort! vector-quick-sort!)
23
24 (define vector-stable-sort vector-merge-sort)
25 (define vector-stable-sort! vector-merge-sort!)
26