From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#47368: 28.0.50; map-elt returns nil without "deprecated" TESTFN Date: Fri, 26 Mar 2021 04:59:29 +0100 Message-ID: <87blb6h8f2.fsf@web.de> References: <87sg4kyw1q.fsf@tcd.ie> <87lfacvtwt.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7745"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: "Basil L. Contovounesios" , dalanicolai , 47368@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 26 05:00:35 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 1lPdeE-0001w3-UQ for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Mar 2021 05:00:34 +0100 Original-Received: from localhost ([::1]:60624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPdeD-0006TI-23 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Mar 2021 00:00:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46342) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPddi-0006So-LV for bug-gnu-emacs@gnu.org; Fri, 26 Mar 2021 00:00:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56806) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lPddi-0005I9-Cz for bug-gnu-emacs@gnu.org; Fri, 26 Mar 2021 00:00:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lPddi-0004L6-7O for bug-gnu-emacs@gnu.org; Fri, 26 Mar 2021 00:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Mar 2021 04:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47368 X-GNU-PR-Package: emacs Original-Received: via spool by 47368-submit@debbugs.gnu.org id=B47368.161673118416590 (code B ref 47368); Fri, 26 Mar 2021 04:00:02 +0000 Original-Received: (at 47368) by debbugs.gnu.org; 26 Mar 2021 03:59:44 +0000 Original-Received: from localhost ([127.0.0.1]:40119 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lPddQ-0004JW-5H for submit@debbugs.gnu.org; Thu, 25 Mar 2021 23:59:44 -0400 Original-Received: from mout.web.de ([212.227.15.14]:59647) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lPddO-0004JJ-9L for 47368@debbugs.gnu.org; Thu, 25 Mar 2021 23:59:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1616731171; bh=+Rg+cBztu3GoLVSgGIblcAF4ba5m2HigisrcXH1UenI=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=pUMEZS7J2KFuahAsxRE1xeTAXqek0yzALKUf/x63XSqyvM9BlQnCLt+QtEvhT6uCL CqcpVa3zijtoUOcei/bln6Lew+BRab+IWVGni16nGSCEXwVO/plMaRKyInmgE/tuCN yQ/lRwbgthd9QxytWiwBqjS6aSQlzbufMod8l/M4= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([188.99.163.242]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M7Kek-1lcL010xC2-00wzyl; Fri, 26 Mar 2021 04:59:31 +0100 In-Reply-To: <87lfacvtwt.fsf@web.de> (Michael Heerdegen's message of "Thu, 25 Mar 2021 03:39:14 +0100") X-Provags-ID: V03:K1:V80cIJy+ErKdjADL6HghyxeJ2Xhjn4wktyWMTPy6zP+pcKX53bW Ooq4JNhdxCdw0DY+xgh9z+z7jFPVEIsCZxf5fHIHS1FQHZaZu/Ul/XXtbZt/f1ExhdpKnUc PsgcJ3pWGxdTwZtMro9+teVcK7Dp26Faso7gA8tMdJwQmj+M2TwHoMRWV6dWICN+eKD79GL AxhKfF3n39xXKFKJWmxkQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:FjrBhb9MqgQ=:uNQheXNB2AxWWeaSWbcgJF tkYwawqaXG6AvHOqin5n9hvdQXtetF5CsfLqCMWAOgeuMNlQODCVxZaPhGvaP67iLka2oMB+c 7YhrpreBndFSpqjXuWeCgyf6N9cO16ykY0sHfEsuX+dN6h204z1PLjVb85X2rFjJsdmbqSfzh QRa/BH7yPIhsqstVjndUbcJTfg7Y1btdXFcqAtz1212ZIzlPgBrAsZaAAVux+8qr9Fg1u6i4G 0UBbtHicvgpraYxLyjRAOkS4cI088L1+YIJLQxRIqHKcQi6Ol1RCguiG30flQ9sL5F8fBLw5m uIF1h4VeRblDHZFS78exQcis9FwdYT+qKEiDLZYB7D+7ppechvxh2rp2DxIoHtHRCjIiAdubc WqXSCPoyNXQTBMTpZBMZaUwFylngzYaw2o7TgSIZ4qE74l+6pDUsm7cEZNCCUmWTqHs54YhDg z9CaQQPwOlh/HyFz9Jd8TCHaka8qqJsNdcSXQBe1WWx4yX4Wk5IFUorYhRWjsNQpUdGTNismS zvT+/O1NCWY5canCe7ralrLf25qJ3pw6LWoqdvLF981MS+KIYGBfI2CQdUOb8jN3XYfFi/0vW Ll574lOrsS+Kx8DWGWwCsgFEIvR8/fFovniBT+8Q1iXzoOJUk5GpSodEiRVkyGU+4J0n9XbLI WOnZnHheb14nhqrEd2IDI/NaxwbjRZw5tQJ4YSCW1m+rFxL7dMUg+Os8cx+erXORSefAPDYR6 8LvAI+6RmR9d67LzxGiogNiO1Gq2hjHUJWKg6E1BojDcmNlKdMmlrDn/rUxAakqF8k9T3+sO 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:203033 Archived-At: Hi Stefan, we are discussing here the limitation for `map-elt' calls with alists caused by deprecating the TESTFN argument (done by you a while ago). What's a good way to solve this? Obviously the map abstraction doesn't fit so super well for alists because unlike the other map type alists don't know "their" test function. But disallowing alists that don't test with `eq' seems an unnecessary restriction. Can we say that the argument is allowed only for alists? Regards, Michael. I wrote: > > > The docstring of the map-elt function from the map.el package (version > > > 3.0) mentions that TESTFN is deprecated because "its default depends on > > > the MAP argument". However when I try e.g. > > > > > > (map-elt '(("A1" . 3)) "A1") > > > > > > it returns nil. > > > > This is expected, as alist keys are tested with eq by default. > > > > That's what the docstring is trying to warn about: alists default to > > testing with eq, but can also use eql, equal, or anything else. > > Is it that obvious? We have `assoc' and `assq' built-in - to me it's > not obvious that "alist keys are tested with eq by default". It's the > default for `alist-get', ok, which is used by the implementation, but > not everybody will know that. I would add a sentence about that.