(defun insert-before (before after lst) (cond ((null lst) nil) ((eql (car lst) after) (cons before lst)) (t (cons (car lst) (insert-before before after (cdr lst)))))) (defun insert-after (before after lst) (cond ((null lst) nil) ((eql (car lst) before) (cons before (cons after (cdr lst)))) (t (cons (car lst) (insert-after before after (cdr lst))))))