SUBST is COPY-TREE with Substitution

SUBST makes a substitution throughout a structure; (SUBST x y z) can be read ``substitute x for y in z''.



(DEFUN SUBST (X Y Z)
  (IF (EQL Y Z)
      X
      (IF (CONSP Z)
          (CONS (SUBST X Y (CAR Z))
                (SUBST X Y (CDR Z)))
          Z) ) )

Contents    Page-10    Prev    Next    Page+10    Index