(defun insert(value sorted-list comparison-fn) (if (equal sorted-list ()) (cons value nil) (if (funcall comparison-fn value (car sorted-list)) (cons value sorted-list) (cons (car sorted-list) (insert value (cdr sorted-list) comparison-fn))))) (defun insert-sort(unsorted-list comparison-fn) "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-fn) comparison-fn)))