help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to flatten a one-level-deep list?


From: tomas
Subject: Re: How to flatten a one-level-deep list?
Date: Wed, 18 May 2016 10:21:23 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

-----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-----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]