From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: How to flatten a one-level-deep list? Date: Fri, 20 May 2016 17:01:23 +0200 Message-ID: <87d1ogixj0.fsf@web.de> References: <877fes54pz.fsf@mbork.pl> <20160518082123.GB4640@tuxteam.de> <87lh37vh9q.fsf@mbork.pl> <86mvnnaxcm.fsf@student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1463756549 12869 80.91.229.3 (20 May 2016 15:02:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 May 2016 15:02:29 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 20 17:02:22 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b3lwS-0001H1-MG for geh-help-gnu-emacs@m.gmane.org; Fri, 20 May 2016 17:02:20 +0200 Original-Received: from localhost ([::1]:55135 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3lwR-0005mB-QN for geh-help-gnu-emacs@m.gmane.org; Fri, 20 May 2016 11:02:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3lvp-0005js-0U for help-gnu-emacs@gnu.org; Fri, 20 May 2016 11:01:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3lvk-0000q3-RP for help-gnu-emacs@gnu.org; Fri, 20 May 2016 11:01:40 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:39482) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3lvk-0000pB-KJ for help-gnu-emacs@gnu.org; Fri, 20 May 2016 11:01:36 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1b3lvd-0000XX-KH for help-gnu-emacs@gnu.org; Fri, 20 May 2016 17:01:29 +0200 Original-Received: from dslb-094-217-122-112.094.217.pools.vodafone-ip.de ([94.217.122.112]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 20 May 2016 17:01:29 +0200 Original-Received: from michael_heerdegen by dslb-094-217-122-112.094.217.pools.vodafone-ip.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 20 May 2016 17:01:29 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 27 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: dslb-094-217-122-112.094.217.pools.vodafone-ip.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.94 (gnu/linux) Cancel-Lock: sha1:lX7r31nPc5oICyqRjUHv53UnrnQ= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:110074 Archived-At: Stefan Monnier writes: > > C-h a flatten RET anyone? > > `flatten' is not a (one-level-deep) list operation, but a tree > operation. How would you call the proposed functionality then? I'm asking because I incidentally need a name for the analog stream operation I want to add to stream.el: #+begin_src emacs-lisp (defun stream-??? (stream-of-streams) "Concatenate all streams in STREAM-OF-STREAMS an return the result. All elements in STREAM-OF-STREAMS must be streams. The result is always a stream." (stream-reduce #'stream-append (stream-empty) stream-of-streams)) #+end_src (`stream-reduce' will be part of the patch; `stream-append' is already existing in stream.el and has signature (&rest streams).) Thanks, Michael.