Complete this function in Lisp to replace all numbers in a list with a given code, including sublists.
(DEFUN HideNumbers (L Code)
(COND ((NULL L) NIL)
; TBD -- Fill in this block
; Check for a number, an atom, otherwise recurse
)
)
(PRINT (HideNumbers '(1 2 SHOE (3 4 DOOR)) 'X)) returns (X X SHOE (X X DOOR))
(PRINT (HideNumbers '(((3)) (((ABC 5 6)))) 'X)) returns (((X)) (((ABC X X))))
Complete this function in Lisp to replace all numbers in a list with a given code, including sublists. (DEFUN HideNumbe
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Complete this function in Lisp to replace all numbers in a list with a given code, including sublists. (DEFUN HideNumbe
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!