From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs] Date: Sun, 10 May 2020 15:31:43 -0400 Message-ID: References: <0c88192c-3c33-46ed-95cb-b4c6928016e3@default> <87wo5mc04t.fsf@fastmail.fm> <99a394b3-9b76-4090-9773-bfc4a745c62b@default> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="98688"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Joost Kremers , "Alfred M. Szmidt" , Richard Stallman , Drew Adams , Emacs developers To: Philippe Vaucher Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 10 21:32:46 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jXrgs-000PY6-7I for ged-emacs-devel@m.gmane-mx.org; Sun, 10 May 2020 21:32:46 +0200 Original-Received: from localhost ([::1]:38354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXrgr-0004jw-9j for ged-emacs-devel@m.gmane-mx.org; Sun, 10 May 2020 15:32:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50980) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXrfy-0003yg-R2 for emacs-devel@gnu.org; Sun, 10 May 2020 15:31:51 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:63021) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXrfx-00011r-5P; Sun, 10 May 2020 15:31:50 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 176EA10077D; Sun, 10 May 2020 15:31:47 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 611BB1003B1; Sun, 10 May 2020 15:31:45 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1589139105; bh=5nB8jU76ojo7ZysjgbCvWLIWwZHBfaXoN3xopOj44/g=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=dj7rxbHGWjv57nl+sKEVRWT3zGVGhy4tmzBnAtzN5zsPdEjIcg1nBsysGQdMDNlW9 dGE39dE60ljaV14cdm4bna1JyEzv0WZZg73D6IYJHnGRPtouS0K1w7syfWVgbLGYaK dPC29Sn3eXSz5yIGjQhXdtoVc7mfiCjA7urA9aKBAwsTtjv2RUggKZRRvBD+1G3tzi gnipOIyAJx9EDasPoLedfsJTw+G5m0Y6M+Mce+nASe9TM0onKxe0yRNVqD80Nf3Bhx qlysJFLpuwP2QGqzok8KcbOxEodfjyMFVNSZrqhNnRz8Yt3w2FTW8wt/qx56lil9np +wS5l3Z/8/zbg== Original-Received: from alfajor (unknown [216.154.3.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id AC0631203B9; Sun, 10 May 2020 15:31:44 -0400 (EDT) In-Reply-To: (Philippe Vaucher's message of "Sun, 10 May 2020 18:56:49 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/10 12:34:28 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:249708 Archived-At: > there I think I just want flatten to exist already. His point was: it's rare to need exactly `flatten` (which BTW is called `flatten-tree` since Emacs-27 ;-). AFAIK in most cases what you really want is something along the lines of (apply #'append X), i.e. a "one-level flatten". As its name implies, `flatten-tree` really operates on a tree, but it's very rare to represent trees in Elisp in such a way that all non-cons cells are elements of the tree, so `flatten-tree` rarely does something meaningful on a tree. But yes, there are several cases where you may happen to know that `flatten-tree` will work because it won't have the opportunity to go deeper than the first level. I.e. you have a "list of lists of strings" or a "list of either strings or lists of strings", so you won't see the difference between `flatten-tree` and a hypothetical one-level flatten. Stefan