Home | Articles | CV (pdf | short)
<2011-06-17> by Lorenzo

sleepsort

To honor the funniest thread in months, here is a lisp implementation of sleepsort!

(use-package :sb-thread)

(defun show (item)
    (sleep item)
    (format t "~S~%" item))

(defun sleep-sort (lst)
    (mapcar
    #'(lambda (item) (make-thread #'(lambda () (show item))))
    lst))