[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: adding a string to every element in a list
From: |
Matthew Flaschen |
Subject: |
Re: adding a string to every element in a list |
Date: |
Mon, 17 Nov 2008 01:06:43 -0500 |
User-agent: |
Thunderbird 2.0.0.17 (X11/20080925) |
Matt Price wrote:
> i have no doubt this is trivial in lisp, but my documentation searches always
> take
> me back to cons, car, and cdr, which don't seem like the easiest tools
> for this task, though maybe it's just that i don't really understan
> recursion...
Just use mapcar, and it will handle the recursion:
(setq list (list "dog" "cat" "fish"));
(mapcar (lambda (arg) (concat arg "food")) list)
Matt Flaschen