(defun insert(value sorted-list comparison-fn) (if (equal sorted-list ()) (cons value nil) (if (funcall comparison value (car sorted-list)) (cons value sorted-list) (cons (car sorted-list) (insert value (cdr sorted-list) comparison))))) (defun insert-sort(unsorted-list comparison) "Insert Sort, takes a list and a function that can compare the items in the list" (if (not (equal unsorted-list ())) (insert (car unsorted-list) (insert-sort (cdr unsorted-list) comparison) comparison)))