From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: print out all members of a list
Date: Mon, 28 Feb 2011 19:32:30 +0100 [thread overview]
Message-ID: <87mxlgovr5.fsf@gmail.com> (raw)
In-Reply-To: 4D6BD989.9010102@mousecar.com
ken <gebser@mousecar.com> 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
next prev parent reply other threads:[~2011-02-28 18:32 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-28 15:20 print out all members of a list ken
2011-02-28 16:50 ` Teemu Likonen
2011-02-28 17:21 ` ken
2011-02-28 18:25 ` print out all members of a list, v.1.0 ken
2011-02-28 18:32 ` Thierry Volpiatto [this message]
2011-02-28 20:26 ` print out all members of a list PJ Weisberg
[not found] ` <mailman.5.1298917525.1451.help-gnu-emacs@gnu.org>
2011-02-28 21:32 ` print out all members of a list, v.1.0 Tim X
2011-03-01 5:48 ` Pascal J. Bourguignon
2011-03-01 6:02 ` rusi
2011-03-02 4:51 ` Barry Margolin
2011-03-02 5:33 ` rusi
2011-03-02 11:56 ` Pascal J. Bourguignon
2011-03-03 0:36 ` Barry Margolin
2011-03-03 9:02 ` Pascal J. Bourguignon
2011-03-03 15:37 ` rusi
2011-03-03 16:00 ` Pascal J. Bourguignon
2011-03-04 2:34 ` Barry Margolin
2011-03-04 4:09 ` Drew Adams
2011-03-04 10:39 ` Pascal J. Bourguignon
2011-03-04 11:06 ` David Kastrup
2011-03-05 3:24 ` Barry Margolin
[not found] ` <mailman.0.1298913700.1451.help-gnu-emacs@gnu.org>
2011-03-01 5:41 ` print out all members of a list Pascal J. Bourguignon
2011-03-01 11:33 ` Andreas Röhler
2011-03-01 11:44 ` Andreas Röhler
[not found] ` <mailman.5.1298979610.15512.help-gnu-emacs@gnu.org>
2011-03-01 13:10 ` Pascal J. Bourguignon
2011-03-01 14:45 ` Stefan Monnier
2011-03-01 14:50 ` Le Wang
2011-03-01 15:10 ` Richard Riley
2011-03-01 18:39 ` Andreas Röhler
[not found] <mailman.4.1298906433.17550.help-gnu-emacs@gnu.org>
2011-02-28 15:24 ` Marc Mientki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mxlgovr5.fsf@gmail.com \
--to=thierry.volpiatto@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).