From: <tomas@tuxteam.de>
To: help-gnu-emacs@gnu.org
Subject: Re: How to flatten a one-level-deep list?
Date: Wed, 18 May 2016 10:21:23 +0200 [thread overview]
Message-ID: <20160518082123.GB4640@tuxteam.de> (raw)
In-Reply-To: <877fes54pz.fsf@mbork.pl>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wed, May 18, 2016 at 07:12:56AM +0200, Marcin Borkowski wrote:
> Hi,
>
> I have a list of lists of atoms, and I want to have a flat list
> containing these atoms. I could use -flatten from dash.el, but I'd
> prefer not to introduce such a dependency for this one function alone.
> Is there anything *in core Emacs* to do it, or should I just write my
> own version?
(setq l '((a b c) (d e f) (g h i)))
(apply 'append l)
=> (a b c d e f g h i)
No idea whether performance or edge cases match your requirements,
though :)
regards
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAlc8JgMACgkQBcgs9XrR2ka6eACfe2VkMvr3Y/asv+Zj+gv2RX3l
sYUAn1gNe9Uozr3NSG2JlmMwIjk9UFaK
=N+Pt
-----END PGP SIGNATURE-----
next prev parent reply other threads:[~2016-05-18 8:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-18 5:12 How to flatten a one-level-deep list? Marcin Borkowski
2016-05-18 8:21 ` tomas [this message]
2016-05-18 9:37 ` Marcin Borkowski
2016-05-18 21:07 ` Emanuel Berg
2016-05-20 12:17 ` Stefan Monnier
2016-05-20 15:01 ` Michael Heerdegen
2016-05-20 17:20 ` Marcin Borkowski
2016-05-20 17:54 ` Michael Heerdegen
2016-05-20 19:51 ` Marcin Borkowski
2016-05-20 22:14 ` Michael Heerdegen
[not found] ` <mailman.46.1463559697.6543.help-gnu-emacs@gnu.org>
2016-05-18 17:52 ` Pascal J. Bourguignon
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=20160518082123.GB4640@tuxteam.de \
--to=tomas@tuxteam.de \
--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).