From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matt Price Newsgroups: gmane.emacs.help Subject: adding a string to every element in a list Date: Mon, 17 Nov 2008 00:51:15 -0500 Organization: History Department, University of Toronto Message-ID: <1226901075.25203.2782.camel@localhost> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1226901112 14215 80.91.229.12 (17 Nov 2008 05:51:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Nov 2008 05:51:52 +0000 (UTC) To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 17 06:52:53 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L1x2b-0000Bi-3N for geh-help-gnu-emacs@m.gmane.org; Mon, 17 Nov 2008 06:52:53 +0100 Original-Received: from localhost ([127.0.0.1]:59938 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L1x1S-0000q4-IP for geh-help-gnu-emacs@m.gmane.org; Mon, 17 Nov 2008 00:51:42 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L1x1B-0000pu-A5 for help-gnu-emacs@gnu.org; Mon, 17 Nov 2008 00:51:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L1x19-0000pW-Nf for help-gnu-emacs@gnu.org; Mon, 17 Nov 2008 00:51:25 -0500 Original-Received: from [199.232.76.173] (port=39213 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L1x19-0000pQ-Gu for help-gnu-emacs@gnu.org; Mon, 17 Nov 2008 00:51:23 -0500 Original-Received: from bureau60.ns.utoronto.ca ([128.100.132.147]:40618) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L1x19-0004Uc-46 for help-gnu-emacs@gnu.org; Mon, 17 Nov 2008 00:51:23 -0500 Original-Received: from anarres.mercey.org (CPE001d7e1d5798-CM0014f8cd1c4c.cpe.net.cable.rogers.com [173.32.83.31]) (authenticated bits=0) by bureau60.ns.utoronto.ca (8.13.8/8.13.8) with ESMTP id mAH5pHL7018065 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 17 Nov 2008 00:51:20 -0500 Original-Received: by anarres.mercey.org (Postfix, from userid 1000) id 2081A120245; Mon, 17 Nov 2008 00:51:16 -0500 (EST) X-Mailer: Evolution 2.24.1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:59853 Archived-At: hi, it's not obvious to me how i would do something as simple as iterating through the elements of a list, modifying each element in hte same way. so in python i would have a list: mylist = ["a" "silly" "list"] for element in mylist: element += ADD and the new list would be ["aADD" "sillyADD" "listADD"] i'm making a list of vcards from a string containing many vcards: (let ((matches (split-string (shell-command-to-string (concat "/home/matt/mutt-eds-query " namestring)) "^END:VCARD" t))))) but unfortunately i need to retain the seperator string, so i want to iterate over each element of the list, changing each element. 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... thanks again, matt -- Matt Price matt.price@utoronto.ca