How do you determine whether a function is a directly recursivefunction? Assume
ID: 3609631 • Letter: H
Question
How do you determine whether a function is a directly recursivefunction? Assume that all necessary definitions have beendefined.In Common Lisp, write a function "recursive-p (fndef)" thatdetermines whether "fndef" is a directly recursive function.
The following function definition, expressed using this grammar,should be used as one of your test cases:
(defun fn (x fn)To test out your solution, you should represent this functiondenition as a list constant and assign it to a variable asfollows:
(cond
((pred fn) (cons x (quote ())))
(T (cons x (fn x fn)))))
(setq fndef '(defun fn ... ))
Explanation / Answer
Solved this problem myself. I'm closing this question.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.