Page 1 of 1

IN CLISP Complete this function in Lisp to replace all numbers in a list with a given code, including sublists. (DEFUN H

Posted: Mon May 09, 2022 7:10 am
by answerhappygod
IN CLISP
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))))