From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#46754: 28.0.50; Various map.el fixes and improvements Date: Mon, 01 Mar 2021 14:59:27 -0500 Message-ID: References: <87zgztcxac.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19999"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 46754@debbugs.gnu.org, nicolas petton To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 01 21:00:28 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1lGoiQ-00055C-JC for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Mar 2021 21:00:26 +0100 Original-Received: from localhost ([::1]:44342 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGoiP-0008A8-Lc for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Mar 2021 15:00:25 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGoi2-00088W-LY for bug-gnu-emacs@gnu.org; Mon, 01 Mar 2021 15:00:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39369) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lGoi2-0005cV-Dv for bug-gnu-emacs@gnu.org; Mon, 01 Mar 2021 15:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lGoi2-0003BY-A5 for bug-gnu-emacs@gnu.org; Mon, 01 Mar 2021 15:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Mar 2021 20:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46754 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 46754-submit@debbugs.gnu.org id=B46754.161462877812173 (code B ref 46754); Mon, 01 Mar 2021 20:00:02 +0000 Original-Received: (at 46754) by debbugs.gnu.org; 1 Mar 2021 19:59:38 +0000 Original-Received: from localhost ([127.0.0.1]:50912 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lGohd-0003AG-Pm for submit@debbugs.gnu.org; Mon, 01 Mar 2021 14:59:38 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:27483) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lGohc-0003A1-1V for 46754@debbugs.gnu.org; Mon, 01 Mar 2021 14:59:36 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 40374441CA1; Mon, 1 Mar 2021 14:59:30 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B1B73441C99; Mon, 1 Mar 2021 14:59:28 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1614628768; bh=bVWKTD4b3t7faEvlKd/kMC2AYsOdDYHQ51TZC/YDvW0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=YEJUckYsEt5YtMvK4acQ6NVUH/2srCwN21rq4McOE/9VQ0qtFoElPcSs/BiHzDESm JfxIhjHRWbkFogmpvpyL0P3Bg0VA4W43VeKxFCEnleKwgZeVMglh71o2xn1QAVBg2P REu2RqVQVIGalMnwXy0eAuecktQ+z3S0RhT2ZEy/EvH23Qi3Hhgp44I3UOHvVZ2tIT EumEf4/Qnfkihd+i9mkbWpD0NGxlTUCTOfve0hwG2J7z11RKSjmR66/RgMCE7gZbz8 X0swl1jA2fm/zeYA01LTbBxLk2FSlKfLDT2i0qtwFZhLuMFiux3KZHql8N4R35vT0x MvF9snhRkIVXQ== Original-Received: from alfajor (unknown [216.154.41.47]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id BC7BF1202CE; Mon, 1 Mar 2021 14:59:28 -0500 (EST) In-Reply-To: <87zgztcxac.fsf@tcd.ie> (Basil L. Contovounesios's message of "Wed, 24 Feb 2021 15:15:07 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:201159 Archived-At: > The attached patch for map.el and seq.el was initially motivated by the > fact that (map--plist-p '(nil 1)) currently returns nil, whereas I'd > expect an alist to begin with a cons. > > Along the way I noticed some other inconsistencies, such as map-do > returning non-nil for alists, and the use of 5-arg alist-get when map.el > expects Emacs 25; and edge cases such as an OBOE on arrays in > map-delete. > > Throughout the patch I assume that cl-defgeneric is generally preferred > over map--dispatch, except where some aspect of the latter can't be > matched by the former, e.g. the use of advertised-calling-convention. > > WDYT? Looks fine to me. I wouldn't advertise the default `map-insert` implementation too much (especially not saying "it works for arrays and hash-tables"), since its performance makes it undesirable (and it is not specific to hash-tables nor arrays). > -In the base definition, MAP can be an alist, hash-table, or array." > +In the base definition, MAP can be a list, hash-table, or array." A list isn't a map, so I think it would be better to write "alist/plist" or somesuch to avoid giving the impression that lists can be treated as maps in general. Stefan