Sorting algorithms/Sleep sort: Difference between revisions
Content deleted Content added
→{{header|Lua}}: Add output |
→{{header|Common Lisp}}: Add implementation |
||
Line 234: | Line 234: | ||
sys 0m0.024s |
sys 0m0.024s |
||
</lang> |
</lang> |
||
=={{header|Common Lisp}}== |
|||
{{works_with|SBCL}} |
|||
<lang lisp>(defun sleeprint(n) |
|||
(sleep (/ n 10)) |
|||
(format t "~a~%" n)) |
|||
(loop for arg in (cdr sb-ext:*posix-argv*) doing |
|||
(sb-thread:make-thread (lambda() (sleeprint (parse-integer arg))))) |
|||
(loop while (not (null (cdr (sb-thread:list-all-threads)))))</lang> |
|||
{{Out}} |
|||
<pre>$ sbcl --script ss.cl 3 1 4 1 5 |
|||
1 |
|||
1 |
|||
3 |
|||
4 |
|||
5 |
|||
</pre> |
|||
=={{header|D}}== |
=={{header|D}}== |