source: project/wiki/eggref/3/orders @ 13621

Last change on this file since 13621 was 13621, checked in by sjamaan, 11 years ago

Move old chicken 3 eggs over to eggref/3

File size: 811 bytes
Line 
1== Introduction
2
3The orders egg provides functions useful for defining orders for sorting.
4
5This documentation is incomplete.
6
7== Dependencies
8
9{{srfi-13}}
10
11== Procedures
12
13[procedure] (cmp-key cmp key)
14
15Generates an ordering procedure that applies the 'key' proc to both
16sort candidates, and compares the resulting keys using the 'cmp'
17procedure.
18
19E.g. to sort a list of integers based on their value modulo-10:
20(sort my-numbers (cmp-key < (cut modulo <> 10)))
21
22[procedure] (key-string< key)
23
24Generates an ordering procedure (see {{cmp-key}}) that sorts strings
25using string< (defined in SRFI-13).
26
27== Not yet documented
28
29[procedure] (key< key)
30
31[procedure] (key> key)
32
33[procedure] (order . cmps)
34
35[procedure] (sort-key-cache alist cmp key)
36
37[procedure] (pick< alist order<)
38
39[procedure] (pick> alist order>)
40
Note: See TracBrowser for help on using the repository browser.