Question: Write a recursive Scheme function with two parameters, an atom and a list, that returns the list with all occurrences, no matter how deep, of

Write a recursive Scheme function with two parameters, an atom and a list, that returns the list with all occurrences, no matter how deep, of the given atom deleted. The returned list cannot contain anything in place of the deleted atoms.

An atom is anything thats not a list, e.g., numbers or symbols. For comparing atoms for equality use eqv?. The pointer equality test eq? is not guaranteed to work for numbers, = only works for numbers. A precise description of these functions can be found in the section Equivalence predicates in the Revised(5) Report on the Algorithmic Language Scheme, which is available off the course web page.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!