fork(1) download
  1. ; friday fun
  2.  
  3. (define (stalin-sort lt? xs)
  4. (let loop ((xs (cdr xs)) (zs (list (car xs))))
  5. (if (null? xs) (reverse zs)
  6. (if (lt? (car zs) (car xs))
  7. (loop (cdr xs) (cons (car xs) zs))
  8. (loop (cdr xs) zs)))))
  9.  
  10. (display (stalin-sort < '(4 2 3 6 1 5)))
Success #stdin #stdout 0.01s 7904KB
stdin
Standard input is empty
stdout
(4 6)