From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#33309: Add flatten-list? Date: Mon, 10 Dec 2018 09:44:55 +0100 Message-ID: <8736r5ojnc.fsf@gmx.de> References: <87r2fw7jsa.fsf@gmail.com> <058f4a0f-7ce4-49c4-ae54-0bc259bd82d1@default> <87pnvg7fgg.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1544431450 9992 195.159.176.226 (10 Dec 2018 08:44:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 10 Dec 2018 08:44:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 33309@debbugs.gnu.org To: Alex Branham Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 10 09:44:06 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gWHAb-0002Ut-H5 for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Dec 2018 09:44:05 +0100 Original-Received: from localhost ([::1]:59766 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gWHCh-0004pm-Bj for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Dec 2018 03:46:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gWHCa-0004pC-SK for bug-gnu-emacs@gnu.org; Mon, 10 Dec 2018 03:46:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gWHCU-0004hD-Ih for bug-gnu-emacs@gnu.org; Mon, 10 Dec 2018 03:46:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36456) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gWHCU-0004h5-EZ for bug-gnu-emacs@gnu.org; Mon, 10 Dec 2018 03:46:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gWHCU-0000NF-BG for bug-gnu-emacs@gnu.org; Mon, 10 Dec 2018 03:46:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Dec 2018 08:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33309 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33309-submit@debbugs.gnu.org id=B33309.15444315091362 (code B ref 33309); Mon, 10 Dec 2018 08:46:02 +0000 Original-Received: (at 33309) by debbugs.gnu.org; 10 Dec 2018 08:45:09 +0000 Original-Received: from localhost ([127.0.0.1]:40714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gWHBd-0000Lu-4F for submit@debbugs.gnu.org; Mon, 10 Dec 2018 03:45:09 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:42759) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gWHBa-0000LG-Q9 for 33309@debbugs.gnu.org; Mon, 10 Dec 2018 03:45:07 -0500 Original-Received: from detlef.gmx.de ([79.140.121.45]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MhRUQ-1groDK0iqA-00Mf3Y; Mon, 10 Dec 2018 09:44:56 +0100 In-Reply-To: <87pnvg7fgg.fsf@gmail.com> (Alex Branham's message of "Wed, 07 Nov 2018 15:19:59 -0600") X-Provags-ID: V03:K1:jmlRMergbAHZvgJkAi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There: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:153299 Archived-At: Alex Branham writes: Hi Alex, >> 1. Even Common Lisp doesn't bother with one. >> (And there are lots of Common Lisp >> functions I'd sooner see added to Emacs.) >> >> 2. It's trivial to define when needed, and >> there are not a lot of existing uses of it. > > Like I said, there's at least four implementations in Emacs of the same > thing, and who knows how many in 3rd-party packages in ELPA or > elsewhere. I'm not sure what you consider "a lot," but DRY kicks in > around three times for me. 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. >> 3. The functions you mention do not all behave >> the same. Even their arg lists are not the >> same. (But sure, they could all be made to >> use a common version, if that were important.) >> >> 4. (flatten-list 42) => (42) >> >> The doc string says nothing about the case >> where the argument LIST (a bad name here) >> is not a list. And if the arg need not be >> a list then "-list" in the function name >> is not good. > > Right, I didn't mean to imply that the one I sent be added in its > current state. I just meant to kick off discussion. I basically > copy/pasted it from somewhere (lpr, I think?). If added it'll need to be > properly documented and perhaps message-flatten-list and the others made > obsolete aliases. 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. > Thanks, > Alex Thanks, and best regards, Michael.