function which builds, from a list, a list without the eleme
Posted: Sat Aug 18, 2018 1:14 am
I'm trying to write a function which builds, from a list, a list without the elements
that begin with a given letter, and by using char and string; example:
What I did so far :
But keeps returning :
What did I miss ?
that begin with a given letter, and by using char and string; example:
Code: Select all
(remove 'n '(nose naked retired art friend)) ==> (art friend retired)
Code: Select all
(defun my-remove (r list)
(cond
((not list) nil)
((equal (char (string (car list))0)#R)(my-remove r(cdr list)))
(t (cons (car list) (my-remove r(cdr list)))) ) )
Code: Select all
(remove 'n '(nose naked retired art friend)) ==> (NOSE NAKED ART FRIEND)