Created
May 20, 2011 05:33
-
-
Save kentaro/982412 to your computer and use it in GitHub Desktop.
sleep-sort
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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