(defun sort (table <)
    (cond ((atom table) table)
          (t (do ((tab (mapcar table (function ncons))))
                 ((atom (cdr tab)) (first tab))
                 (do ((x (first tab) (cond ((atom l) (exit)) (t (pop l))))
                      (y (second tab) (cond ((atom l) (exit)) (t (pop l))))
                      (l (cddr tab))
                      (rep tab (cdr rep)))
                     (nil)
                     (and (funcall < (first y) (first x)) (setq x y y x))
                     (rplaca (rplacd rep (cddr rep)) x)
                     (do ((w x x))
                         ((atom (setq x (cdr x))) (rplacd w y))
                         (and (funcall < (first y) (first x)) (setq x y y x))
                         (rplacd w x)))))))
