From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Petton Newsgroups: gmane.emacs.devel Subject: Re: Including some functions from dash.el in Emacs? Date: Wed, 29 Oct 2014 14:16:26 +0100 Message-ID: <87ppdb6mol.fsf@gmail.com> References: <87wq7j72wz.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1414588613 19900 80.91.229.3 (29 Oct 2014 13:16:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Oct 2014 13:16:53 +0000 (UTC) Cc: Emacs development discussions To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 29 14:16:47 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 1XjT7E-0004GM-D2 for ged-emacs-devel@m.gmane.org; Wed, 29 Oct 2014 14:16:44 +0100 Original-Received: from localhost ([::1]:46021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjT7D-0002aT-V6 for ged-emacs-devel@m.gmane.org; Wed, 29 Oct 2014 09:16:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjT76-0002Xy-Co for emacs-devel@gnu.org; Wed, 29 Oct 2014 09:16:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjT6z-0006Ii-7y for emacs-devel@gnu.org; Wed, 29 Oct 2014 09:16:36 -0400 Original-Received: from mail-lb0-x22e.google.com ([2a00:1450:4010:c04::22e]:51458) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjT6z-0006Ic-0C for emacs-devel@gnu.org; Wed, 29 Oct 2014 09:16:29 -0400 Original-Received: by mail-lb0-f174.google.com with SMTP id z11so459866lbi.19 for ; Wed, 29 Oct 2014 06:16:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-type; bh=6YTYO+aOo2hUnnhX/qaaAyJffOaMWVFs/W1FhxReiXs=; b=0qPVOTQOVCD0agpMqFJkWeUDJ+WslbweFk3X3kfAvE+7ylJN9rBZCK717dCTZMLfIs +u/tgNAYPCrLBT5m8cTcdCqVqqtQiOnFDI9NfHDcVAbO2aKeKtP6sgQiN7zC3A2Er5us 6gdY7Uj5FXd9tsA61XyJy5RHUbjFy+KzNh7yzQmW/YlE86/ZF+opibXuWme0xiI9eySV a5Iz78sVRIFIfffu1iSCp9TeliXDrdthZStGN+8XhddEjcW+eU0tuwhwH2rXVdZimHlz NcpBLrh6LmzWiMKTQO0UJ3PnjNQ+wPTbZiJLyAP9BlnLNYXvBQlFaqETTYPevTZ6iKly tGYg== X-Received: by 10.112.138.39 with SMTP id qn7mr11285047lbb.57.1414588587778; Wed, 29 Oct 2014 06:16:27 -0700 (PDT) Original-Received: from blueberry (31-211-216-84.customers.ownit.se. [31.211.216.84]) by mx.google.com with ESMTPSA id pm3sm1931604lbb.15.2014.10.29.06.16.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Oct 2014 06:16:27 -0700 (PDT) User-agent: mu4e 0.9.9.6pre3; emacs 24.3.1 In-reply-to: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::22e 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:175984 Archived-At: Stefan Monnier writes: >> 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? Indeed, but I thought that having it builtin (ie no cl-lib required) would make Elisp better. Maybe that's just me but I always see cl-lib as a compatibility layer for CL, not something that I should almost always load in order to have decent manipulation list functions. Cheers, Nico > > 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 -- Nicolas Petton http://nicolas-petton.fr