Page 3 of 3

Re: Replacing elements in a list

Posted: Wed Jun 10, 2009 3:17 am
by Lispoman
Nope I say it again... It isnt homework

Re: Replacing elements in a list

Posted: Wed Jun 10, 2009 1:17 pm
by Paul Donnelly
Lispoman wrote:Nope I say it again... It isnt homework
Then why in the world are you so obsessed with this? LAMBDA isn't something you just “modify a function with” — what you say you want to do makes absolutely no sense that I can see. :| Could you describe the intended effect of this modification in more detail?

Re: Replacing elements in a list

Posted: Wed Jun 10, 2009 6:29 pm
by gugamilare
Lispoman wrote:Nope I say it again... It isnt homework
The reason people here is thinking that this is homework is that no one is understanding what exactly you want, what you are saying makes no sense. When someone say something that makes no sense it usually means that that person got an exercise wrong.

Perhaps what you want is to use mapcar to avoid recursion?

Code: Select all

(defun myfunc (x)
  (mapcar (lambda (elt)
            (if (< elt 0)
                (intern (format nil "*~a" elt))
                elt))
          x))