RosettaCodeData/Task/Optional-parameters/Common-Lisp/optional-parameters-1.lisp

8 lines
278 B
Common Lisp
Raw Permalink Normal View History

2013-04-10 23:57:08 -07:00
(defun sort-table (table &key (ordering #'string<)
(column 0)
reverse)
(sort table (if reverse
(complement ordering)
ordering)
:key (lambda (row) (elt row column))))