Hello, Do you read guile-devel and are looking for a manageable thing to hack? Well how about this. `sort!' needs a #:key argument.
I believe you will find more precise specifications in the Common Lisp specifications, but the basic idea is that the comparison function of `sort' operates not on elements of the list, but on the result of applying a function to those elements. Like this: (sort '(1 -2 3 -4) <) => (-4 -2 1 3) (sort '(1 -2 3 -4) < #:key (lambda (x) (* x x))) => (1 -2 3 -4) (sort '((a . 1) (b . -2) (c . 3)) < cdr) => ((b . -2) (a . 1) (c . 3)) I would do it by exposing scm_sort to Scheme as primitive-sort, and defining a `sort' in scheme using (ice-9 optargs) and primitive-sort, customizing the less? procedure if a #:key is given. Then we'd need to update the documentation, and add a news entry. Any takers? :) Andy -- http://wingolog.org/