From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.help Subject: Re: print out all members of a list Date: Mon, 28 Feb 2011 19:32:30 +0100 Message-ID: <87mxlgovr5.fsf@gmail.com> References: <4D6BBD34.6050407@mousecar.com> <4D6BD989.9010102@mousecar.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1298918234 10951 80.91.229.12 (28 Feb 2011 18:37:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 28 Feb 2011 18:37:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Feb 28 19:37:10 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 1Pu7y1-0003Hf-Mo for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Feb 2011 19:37:09 +0100 Original-Received: from localhost ([127.0.0.1]:40747 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pu7uL-0001WR-36 for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Feb 2011 13:33:21 -0500 Original-Received: from [140.186.70.92] (port=34120 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pu7tt-0001VK-0F for help-gnu-emacs@gnu.org; Mon, 28 Feb 2011 13:32:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pu7tq-0000DP-Tc for help-gnu-emacs@gnu.org; Mon, 28 Feb 2011 13:32:52 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:35504) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pu7tq-0000D3-O1 for help-gnu-emacs@gnu.org; Mon, 28 Feb 2011 13:32:50 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Pu7to-0000W0-Cr for help-gnu-emacs@gnu.org; Mon, 28 Feb 2011 19:32:48 +0100 Original-Received: from 238.78.88-79.rev.gaoland.net ([79.88.78.238]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 28 Feb 2011 19:32:48 +0100 Original-Received: from thierry.volpiatto by 238.78.88-79.rev.gaoland.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 28 Feb 2011 19:32:48 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 49 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 238.78.88-79.rev.gaoland.net User-Agent: Gnus/5.110014 (No Gnus v0.14) Emacs/23.2.94 (gnu/linux) Cancel-Lock: sha1:1hfULZhh+A19m+75v5c7EKp2hGI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 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:79574 Archived-At: ken writes: > On 02/28/2011 10:20 AM ken wrote: >> (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. >> > > I've been criticized for my elisp terminology-- and properly so--, so > let me rephrase: > > (car '("one" "two" "three")) > > returns a string consisting of the first element (?) of the list. Is > there an elisp function which either (1) returns one string for each > element of the list or (2) returns one string containing all elements of > the list? > > E.g.: > > (1) "one" "two" "three" (loop for i in '("one" "two" "three") do (princ (concat "\"" i "\"" " "))) > or > > (2) "onetwothree" (mapconcat 'identity '("one" "two" "three") " ") ==>"one two three" > preferably (1). > > > Thanks again. > > > P.S. It seems strange that elisp has so many ways to manipulate lists, > but doesn't seem to have this very simple functionality. Because "one" "two" "three" is unusable in code if not in a container. (i.e it is three differents objects, but not one) -- A+ Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997