Skip to content

Instantly share code, notes, and snippets.

@kentaro
Created May 20, 2011 05:33
Show Gist options
  • Save kentaro/982412 to your computer and use it in GitHub Desktop.
Save kentaro/982412 to your computer and use it in GitHub Desktop.
sleep-sort
(require 'deferred)
(defun sleep-sort (list)
(mapc (lambda (i)
(lexical-let ((sec i))
(deferred:$
(deferred:wait (* sec 1000))
(deferred:nextc it
(lambda ()
(princ (format "%d\n" sec)))))))
list))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment