From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: print out all members of a list Date: Tue, 01 Mar 2011 19:39:16 +0100 Message-ID: <4D6D3D54.1080401@easy-emacs.de> References: <4D6BBD34.6050407@mousecar.com> <87y64zvvf0.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1299004538 12663 80.91.229.12 (1 Mar 2011 18:35:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 1 Mar 2011 18:35:38 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 01 19:35:34 2011 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.69) (envelope-from ) id 1PuUPy-0007ws-Jh for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Mar 2011 19:35:30 +0100 Original-Received: from localhost ([127.0.0.1]:39635 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuUPx-0005nP-Sb for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Mar 2011 13:35:29 -0500 Original-Received: from [140.186.70.92] (port=46454 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuUPZ-0005jN-2R for help-gnu-emacs@gnu.org; Tue, 01 Mar 2011 13:35:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PuUPX-0001va-QF for help-gnu-emacs@gnu.org; Tue, 01 Mar 2011 13:35:05 -0500 Original-Received: from moutng.kundenserver.de ([212.227.126.187]:61122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PuUPX-0001v0-EF for help-gnu-emacs@gnu.org; Tue, 01 Mar 2011 13:35:03 -0500 Original-Received: from [192.168.178.29] (brln-4d0c18d7.pool.mediaWays.net [77.12.24.215]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0LhTlI-1QPNFk0Xbs-00modp; Tue, 01 Mar 2011 19:35:00 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6 In-Reply-To: <87y64zvvf0.fsf@kuiper.lan.informatimago.com> X-Provags-ID: V02:K0:dw31yTdh2OAt3xJ0ObcH68xMrAtNaGYSVy7SWHnuVjc J7KM7dEih3gVOQNyo9ye8V2JHcG4+az4WGvUy7w1vdDCgob8Sk hBynWD0cZ6KlEIDoDQqBg6yYYr/IpL2NAG2NVUQstGHPTQ2F3c CHWN038tkWecK2kox5TuCweAwFD0yI+0x4Bsji31SwJ6iLuX5I cP7D3gxBPMSvrrICIGYTkkebMhM7RfzB30FA02N54Q= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.227.126.187 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:79649 Archived-At: Am 01.03.2011 14:10, schrieb Pascal J. Bourguignon: > Andreas Röhler writes: > >> Am 28.02.2011 16:20, schrieb ken: >>> (car '("one" "two" "three")) >>> >>> prints out "one" ... the first of the list. How to print out all >>> elements of the list (in order and with the double quotes around them? >>> I'm actually looking just to substitute something for "car" and not >>> write an entire function. Or is there no such thing? >>> >>> Thanks much. >>> >>> >> >> and still a form delivering with doublequotes... >> >> (let ((my-list (list "one" "two" "three"))) >> (dolist (elem my-list) >> (insert (format "\n\"%s\"" elem)))) > > Why do you write broken code? > > (let ((my-list (list "o\"n\"e" "t\"wo" "th\\\"ree"))) > (dolist (elem my-list) > (insert (format "\n\"%s\"" elem)))) > > "o"n"e" > "t"wo" > "th\"ree" > > > Is it not easier to write code that works? > > (let ((my-list (list "o\"n\"e" "t\"wo" "th\\\"ree"))) > (dolist (elem my-list) > (insert (format "\n%s" (prin1-to-string elem))))) > > "o\"n\"e" > "t\"wo" > "th\\\"ree" > > Ok, thanks, interesting point. From there `concat' read better for me (let ((my-list (list "o\"n\"e" "t\"wo" "th\\\"ree"))) (dolist (elem my-list) (insert (concat "\n" (prin1-to-string elem))))) (?) :-)