From: Sherif Elbanhawy
Subject: Help...Introduction to lisp
Date:
Message-ID: <3cbbd297$1_3@Usenet.com>
Hey guys this is me again, thanks with all the help with the first problem i
had. now I had another question...
I am trying to have a function that will convert the element of this nested
list to X's
This is what I got so far
(defun replace (L)
(cond
((null L) nil)
((atom L) (setf L 'X))
(t (list (replace (car L)) (replace (cdr L))))))
this is working but the problem is when I give it a list like this:
(a b d e f r t)
it returns:
(X (X (X (X (X (X (X NIL)))))))
Instead of what I want which is :
(X X X X X X X)
I know the the problem is in the list finction I am using...What should I
use instead and is there anything else that I need to do??
Thanks a lot
Sherif
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com