Question: write a LISP predicate/code MULTIPLE-MEMBER that takes two arguments and behaves as follows: If the first argument is a symbol or number and the second

write a LISP predicate/code MULTIPLE-MEMBER that takes two arguments and behaves as follows: If the first argument is a symbol or number and the second is a list, then MULTIPLE-MEMBER returns a true value if the first argument occurs at least twice in the second argument, and returns NIL otherwise. Examples: (MULTIPLE-MEMBER 'A '(B A B B A C A D)) => (A C A D) (MULTIPLE-MEMBER 'A '(B A B B C C A D)) => (A D) (MULTIPLE-MEMBER 'A '(B A B B C D)) => NIL [Notice that the behavior of MULTIPLE-MEMBER is unspecified in cases where the first argument is not a symbol or number, and in cases where the second argument is not a list. In other words, your definition may return any value or produce an evaluation error in such cases.]

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!