From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#58563: 29.0.50; Generic functions and advertised-calling-convention Date: Mon, 24 Oct 2022 15:50:18 -0400 Message-ID: References: <878rlgjcbl.fsf@tcd.ie> <87czaih35g.fsf@tcd.ie> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6305"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 58563@debbugs.gnu.org To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 24 22:23:47 2022 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 1on3z6-0001N4-9h for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Oct 2022 22:23:44 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1on3TU-0004fW-Or; Mon, 24 Oct 2022 15:51:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1on3TS-0004dS-Dh for bug-gnu-emacs@gnu.org; Mon, 24 Oct 2022 15:51:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1on3TS-0004kE-39 for bug-gnu-emacs@gnu.org; Mon, 24 Oct 2022 15:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1on3TR-0008W9-QP for bug-gnu-emacs@gnu.org; Mon, 24 Oct 2022 15:51:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Oct 2022 19:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58563 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 58563-submit@debbugs.gnu.org id=B58563.166664103132700 (code B ref 58563); Mon, 24 Oct 2022 19:51:01 +0000 Original-Received: (at 58563) by debbugs.gnu.org; 24 Oct 2022 19:50:31 +0000 Original-Received: from localhost ([127.0.0.1]:49605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1on3Sw-0008VM-Ni for submit@debbugs.gnu.org; Mon, 24 Oct 2022 15:50:31 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:27524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1on3Su-0008V7-J7 for 58563@debbugs.gnu.org; Mon, 24 Oct 2022 15:50:29 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D48AF441BED; Mon, 24 Oct 2022 15:50:22 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 4C32D4418F5; Mon, 24 Oct 2022 15:50:21 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1666641021; bh=jbJKDiyCMywdkineY/iqWQHv9L8ZguhUtIK2NUE9frA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=dk6qawaxCvaknJ1pLyCQfAsZQB0pNuRYOLsW1sSNQsH2jCRjMT5T8lAmKrMf3uC5k IXt2DXMGvEqzFIB+Q/6UF7GI6UbMCyqnk0f+FiedMDrqi8y0ZSAU7W6mGt9GEXsXVd fdf3QqXpkQ4XjKjgWSC0xUKKVrocVx9RkH+KOu6UwqZ99jCOSfRrkzpfysAaDFR9is BEpOQgUxgojV6np73tVDXDzXUxZOOim8mHV56Fqm05SRAkkbkyvv05zerOUBuiZ8J8 K18+07GEhgNABzku7uYMzFqXsK/KtZz/moLSaroHUspgrOZneB4o7+ASRnjb6TFBSA H1hfhy5WOUKgg== Original-Received: from alfajor (modemcable219.124-130-66.mc.videotron.ca [66.130.124.219]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id EED75120513; Mon, 24 Oct 2022 15:50:20 -0400 (EDT) In-Reply-To: <87czaih35g.fsf@tcd.ie> (Basil L. Contovounesios's message of "Sun, 23 Oct 2022 20:15:55 +0300") 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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246122 Archived-At: >> Not this, OTOH. > Do we want this fixed? Maybe. > Currently C-h f map-contains-key RET says: > > map-contains-key is a byte-compiled Lisp function in =E2=80=98map.el=E2= =80=99. > (map-contains-key MAP KEY) > Return non-nil if and only if MAP contains KEY. > TESTFN is deprecated. Its default depends on MAP. > The default implementation delegates to =E2=80=98map-some=E2=80=99. > Probably introduced at or before Emacs version 27.1. > This is a generic function. > Implementations: > (map-contains-key (MAP hash-table) KEY &optional TESTFN) in =E2=80=98ma= p.el=E2=80=99. > Return non-nil if MAP contains KEY, ignoring TESTFN. > (map-contains-key (MAP array) KEY &optional TESTFN) in =E2=80=98map.el= =E2=80=99. > Return non-nil if KEY is an index of MAP, ignoring TESTFN. > (map-contains-key (MAP list) KEY &optional TESTFN) in =E2=80=98map.el= =E2=80=99. > Return non-nil if MAP contains KEY. > If MAP is an alist, TESTFN defaults to =E2=80=98equal=E2=80=99. > If MAP is a plist, TESTFN defaults to =E2=80=98eq=E2=80=99. > (map-contains-key MAP KEY &optional TESTFN) in =E2=80=98map.el=E2=80=99. > Undocumented The current code also allows things like a (A B Rest C) in the defgeneric and then more precise args in the methods, > I don't know whether that's better or worse, with all the references to > the seemingly nonexistent TESTFN. Exactly. It's not clear what's "right", so I think it's better to err on the safer(?) side and apply the `advertised-calling-convention` to the place where it's set. `advertised-calling-convention` is not used very often (and that's good), so I don't think it's super important to do the very best we can with it. We currently cover byte-compiler warnings when too many args are passed, the arglist in Eldoc, and the top-line arglist in `C-h f`. I think it's pretty good already. Stefan