Question: LISP programming Write and run a recursive Lisp function called my-replace which takes three S-expressions (call them S1, S2, and S3). It replaces S2 by
LISP programming

Write and run a recursive Lisp function called my-replace which takes three S-expressions (call them S1, S2, and S3). It replaces S2 by S3 whenever S2 occurs as a first level element in Si. Assume that S1 is a list. S2 and S3 may be either atoms or lists. For instance: (my-replace '(A (BC)D) '(B C) 'X) (A X D)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
