From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Including some functions from dash.el in Emacs? Date: Wed, 29 Oct 2014 08:50:59 -0400 Message-ID: References: <87wq7j72wz.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1414587109 26986 80.91.229.3 (29 Oct 2014 12:51:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Oct 2014 12:51:49 +0000 (UTC) Cc: Emacs development discussions To: Nicolas Petton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 29 13:51:42 2014 Return-path: Envelope-to: ged-emacs-devel@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 1XjSiw-0005wn-7w for ged-emacs-devel@m.gmane.org; Wed, 29 Oct 2014 13:51:38 +0100 Original-Received: from localhost ([::1]:45632 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjSiv-0004JI-UC for ged-emacs-devel@m.gmane.org; Wed, 29 Oct 2014 08:51:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjSiW-00044z-Aj for emacs-devel@gnu.org; Wed, 29 Oct 2014 08:51:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjSiK-0006UO-Oo for emacs-devel@gnu.org; Wed, 29 Oct 2014 08:51:12 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:4160) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjSiK-0006U5-Lc for emacs-devel@gnu.org; Wed, 29 Oct 2014 08:51:00 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvgMAOatTlRFpY87/2dsb2JhbABcgw6DYoZ+xz+EFAQCAoEcFwEBfIQDAQEDAVYjBQsLNBIUGA0kiEsJy3IBAQEHAgEfkQgHhEsFmRKZDoFvhBQhgnoBAQE X-IPAS-Result: AvgMAOatTlRFpY87/2dsb2JhbABcgw6DYoZ+xz+EFAQCAoEcFwEBfIQDAQEDAVYjBQsLNBIUGA0kiEsJy3IBAQEHAgEfkQgHhEsFmRKZDoFvhBQhgnoBAQE X-IronPort-AV: E=Sophos;i="5.04,797,1406606400"; d="scan'208";a="95500795" Original-Received: from 69-165-143-59.dsl.teksavvy.com (HELO pastel.home) ([69.165.143.59]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 29 Oct 2014 08:50:59 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 242347ABE; Wed, 29 Oct 2014 08:50:59 -0400 (EDT) In-Reply-To: <87wq7j72wz.fsf@gmail.com> (Nicolas Petton's message of "Wed, 29 Oct 2014 08:25:48 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:175979 Archived-At: > think it would be great if Elisp had them builtin, like `flatten`, > `filter` or `reduce`. IIUC, `filter' is covered by `cl-remove-if`, and `reduce' is called `cl-reduce', right? As for `flatten', all the examples I've seen where it's used have been either cases where I think that using a different structure would have made simpler&clearer code (and removed the need for `flatten'), or where you really really got lucky. If you think about types, flatten can't make sense for lists (since lists are typically "lists of " but not "list of list of list of list of list ..."), so it is only really useful for trees where it gives you the in-order elements of the tree, so it only works for trees with no extra meta info. In those tree cases, I believe that a tree-traversal-iterator would be more useful. > Would it make sense to include some of the dash.el functions into Emacs? I'm in the process of trying to get dash.el included in GNU ELPA. I haven't decided yet whether or when it should go into Emacs or stay in GNU ELPA. Stefan