[racket-dev] Feature request: multiple keys in sort

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Sun Jun 10 16:39:19 EDT 2012


On Jun 9, 2012, at 10:56 AM, Harry Spier wrote:

> Would it be possible to extend the sort function to allow for multiple
> keys to facilitate sorting lists of lists or lists of structs.


It is possible to sort lists of lists and lists of structs:
Welcome to DrRacket, version 5.3.0.10--2012-06-09(6b2419f1/d) [3m].
Language: racket.
> (sort '((1 0 2) (9 7 8) (6 2 5)) > #:key second)
'((9 7 8) (6 2 5) (1 0 2))

;; --- 

Do you want to supply multiple comparisons for multiple keys? 


Posted on the dev mailing list.