As bonus an implementation of bubblesort is given.
(defun bubblesort (l predicate &optional (ptr 0) (swap-made nil))
(if (< ptr (1- (length l)))
(if (funcall predicate (nth ptr l) (nth (1+ ptr) l))
(progn
(let ( (tmp (nth ptr l)))
(setf (nth ptr l) (nth (1+ ptr) l))
(setf (nth (1+ ptr) l) tmp)
(setf swap-made t)
(bubblesort l predicate (1+ ptr) swap-made)))
(progn
(bubblesort l predicate (1+ ptr) swap-made )))
(if (equal swap-made t)
(bubblesort l predicate 0 nil)
l)))
(defun lengthp (l1 l2)
(< (length l1) (length l2)))