unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: Alex Branham <alex.branham@gmail.com>, 33309@debbugs.gnu.org
Subject: bug#33309: Add flatten-list?
Date: Mon, 10 Dec 2018 12:49:03 -0500	[thread overview]
Message-ID: <jwvftv51dku.fsf-monnier+bug#33309@gnu.org> (raw)
In-Reply-To: <8736r5ojnc.fsf@gmx.de> (Michael Albinus's message of "Mon, 10 Dec 2018 09:44:55 +0100")

> For the records, in Tramp I need also this function. I'm just going to
> define it myself (derived from eshell-flatten-list), but I'll happily
> switch to a common flatten-list.

If you do, please use an appropriate name: if it recurses arbitrarily, it
means it's flattening a *tree* not a *list*.  IOW if we want to provide
`list-flatten` (or `seq-flatten`) it would have to look a bit like

    (apply #'append list)

without the recursion.

> Unless nobody else objects, I'd like to encourage you to prepare a patch
> to be added to the master branch. This could include the replacement of
> the existing implementations.

Agreed.  Just make sure the name clarifies it's working on a tree
(e.g. depending on how you define the function, it can be considered as
a function that returns all the leaves of a given tree).


        Stefan





  reply	other threads:[~2018-12-10 17:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-07 19:46 bug#33309: Add flatten-list? Alex Branham
2018-11-07 20:36 ` Drew Adams
2018-11-07 21:19   ` Alex Branham
2018-12-10  8:44     ` Michael Albinus
2018-12-10 17:49       ` Stefan Monnier [this message]
2018-12-10 20:12         ` Alex Branham
2018-12-10 21:36           ` Stefan Monnier
2018-12-10 23:06             ` Alex Branham
2018-12-11 12:36               ` Stefan Monnier
2018-12-10 22:42           ` Basil L. Contovounesios
2018-12-10 23:17             ` Alex Branham
2018-12-10 23:26               ` Basil L. Contovounesios
2018-12-10 23:34               ` Stephen Berman
2018-12-11  8:21               ` Michael Albinus
2018-12-11  8:34               ` martin rudalics
2018-12-11 17:36 ` bug#33309: [PATCH] flatten-list Alex Branham
2018-12-11 20:11   ` Michael Albinus
2018-12-11 20:16     ` Alex Branham
2018-12-17 11:33       ` Michael Albinus

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='jwvftv51dku.fsf-monnier+bug#33309@gnu.org' \
    --to=monnier@iro.umontreal.ca \
    --cc=33309@debbugs.gnu.org \
    --cc=alex.branham@gmail.com \
    --cc=michael.albinus@gmx.de \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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