;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/sort-list.el (require 'cl-lib) (defun sleep-sort (&rest lst) (let ((sorted)) (dolist (n lst) (run-with-timer (* n 0.001) nil (lambda () (push n sorted))) ) (cl-loop while (> (length lst) (length sorted)) for i from 0 do (sleep-for (expt 2 i)) ) (nreverse sorted) )) ;; (sleep-sort 3 1 4 1 5 92 65 3 5 89 79 3) (provide 'sort-list)