Re: [racket] complex sort or how to sort lines

2012-05-26 Thread Matthias Felleisen
On May 26, 2012, at 10:32 AM, Don Green wrote: > (with-output-to-file file > #:exists 'replace > (lambda () >(for ((ch content)) (display ch ;< ;; --- test > (check-equal? (with-output-to-string > (lambda () > (for ((ln (answer file))) >

Re: [racket] complex sort or how to sort lines

2012-05-25 Thread Pierpaolo Bernardi
On Fri, May 25, 2012 at 6:16 PM, Don Green wrote: > Given the output of Racket's read-words/line function, which produces a list > of lists. Each word is in a list, each group of words on a line is in a > list, all within a list. > > Any ideas on how to sort on the car (first element) of each list

Re: [racket] complex sort or how to sort lines

2012-05-25 Thread Matthias Felleisen
On May 25, 2012, at 12:16 PM, Don Green wrote: > Given the output of Racket's read-words/line function, which produces a list > of lists. Each word is in a list, each group of words on a line is in a list, > all within a list. > > Any ideas on how to sort on the car (first element) of each li

[racket] complex sort or how to sort lines

2012-05-25 Thread Don Green
Given the output of Racket's read-words/line function, which produces a list of lists. Each word is in a list, each group of words on a line is in a list, all within a list. Any ideas on how to sort on the car (first element) of each list that corresponds to a line? In other words, I want to sort