Hi there,
I have just entered the world of LISP so I'm a bit of a newbie!
I want to change a list containing something like (2 x + 1) into something like (2 x) i.e. I want to find and delete all (+ 1)s in a list.
I am familiar with the delete function but that only takes an atom:
(delete '+ '(2 x + 1))
(2 x 1)
and
(delete '(+ 1) '(2 x + 1))
(2 x + 1)
I can write something to find a sequence i.e. + 1 in a list but how do I delete the sequence?
Thanks in advance
I have just entered the world of LISP so I'm a bit of a newbie!
I want to change a list containing something like (2 x + 1) into something like (2 x) i.e. I want to find and delete all (+ 1)s in a list.
I am familiar with the delete function but that only takes an atom:
(delete '+ '(2 x + 1))
(2 x 1)
and
(delete '(+ 1) '(2 x + 1))
(2 x + 1)
I can write something to find a sequence i.e. + 1 in a list but how do I delete the sequence?
Thanks in advance