Fix sort procedure in base system
This commit is contained in:
parent
50063d4523
commit
471d24ce38
|
@ -1092,14 +1092,16 @@
|
||||||
(simple-sort grtr))))))
|
(simple-sort grtr))))))
|
||||||
|
|
||||||
(define (sort l (less? <) (key identity))
|
(define (sort l (less? <) (key identity))
|
||||||
(if (or (null? l) (null? (cdr l))) l
|
(let sort ((l l))
|
||||||
|
(if (or (null? l) (null? (cdr l)))
|
||||||
|
l
|
||||||
(let ((piv (car l)))
|
(let ((piv (car l)))
|
||||||
(receive (less grtr)
|
(receive (less grtr)
|
||||||
(separate (lambda (x) (less? (key x) (key piv)))
|
(separate (lambda (x) (less? (key x) (key piv)))
|
||||||
(cdr l))
|
(cdr l))
|
||||||
(nconc (sort less)
|
(nconc (sort less)
|
||||||
(list piv)
|
(list piv)
|
||||||
(sort grtr))))))
|
(sort grtr)))))))
|
||||||
|
|
||||||
(define (apropos-list key)
|
(define (apropos-list key)
|
||||||
(let ((key (string-downcase
|
(let ((key (string-downcase
|
||||||
|
|
Loading…
Reference in New Issue