mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 13:49:17 +02:00
Adding a list sorting example.
This commit is contained in:
parent
a8798e24c3
commit
4fa1eacaa6
1 changed files with 7 additions and 0 deletions
|
@ -45,6 +45,13 @@
|
|||
(sort '("elephant" "CaT" "DOG" "ape" "GoAt" "Fox" "HAWK" "Bear")
|
||||
string-ci<?))
|
||||
|
||||
(test "sort lists"
|
||||
'((chibi) (scheme r5rs) (scheme write))
|
||||
(sort '((chibi) (scheme r5rs) (scheme write))
|
||||
(lambda (a b)
|
||||
(string<? (call-with-output-string (lambda (out) (write a out)))
|
||||
(call-with-output-string (lambda (out) (write b out)))))))
|
||||
|
||||
(test "sort numeric inexact vector <" '#(1.1 2.2 3.3 4.4 5.5 6.6 7.7 8.8 9.9)
|
||||
(sort '#(7.7 5.5 2.2 8.8 1.1 6.6 4.4 9.9 3.3) <))
|
||||
(test "sort numeric signed inexact vector <"
|
||||
|
|
Loading…
Add table
Reference in a new issue