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: Sun, 16 Oct 2022 12:05:33 -0400 Message-ID: References: <878rlgjcbl.fsf@tcd.ie> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17225"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) 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 Sun Oct 16 18:07:33 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 1ok6An-0004Iu-2Y for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 Oct 2022 18:07:33 +0200 Original-Received: from localhost ([::1]:52870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ok6Al-0004iz-Kg for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 Oct 2022 12:07:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ok69P-0004hk-52 for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2022 12:06:08 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46837) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ok69L-0007Pj-02 for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2022 12:06:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ok69K-0006SN-Du for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2022 12:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 16 Oct 2022 16:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58563 X-GNU-PR-Package: emacs Original-Received: via spool by 58563-submit@debbugs.gnu.org id=B58563.166593634824796 (code B ref 58563); Sun, 16 Oct 2022 16:06:02 +0000 Original-Received: (at 58563) by debbugs.gnu.org; 16 Oct 2022 16:05:48 +0000 Original-Received: from localhost ([127.0.0.1]:45915 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok696-0006Rq-3r for submit@debbugs.gnu.org; Sun, 16 Oct 2022 12:05:48 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:38634) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok694-0006Rd-3n for 58563@debbugs.gnu.org; Sun, 16 Oct 2022 12:05:47 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 76DE480781; Sun, 16 Oct 2022 12:05:40 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 898FB80261; Sun, 16 Oct 2022 12:05:34 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1665936334; bh=BIOSdnm//gkdThjxDZluxx2M6St//icEyX9BE0fNRZc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Bl856v4pO1L3lxsfWCJDDJX+q4n1wE6LekVLlOuRzKEipLEuCzOomaTXju8GwUmQB dUCxGudIpTFPiW3k1/PGvc0YueIj0yPA8CS4i5SErmS9ffmKfBcmAOUFiIkxQl4YEN NyKYIczxF38mP4ymL93S1CYPDHxBP2+FQ3HqPfMT5pRex8HSVoXbzC3XIPRip3cCme 7mtCA5ExbvLCk5gC7Hm1LOKP4MhBhT93ArbbosHxrYk+H+XDwT2khKEg7vepz5DNtL 1cdlc4DWZOl3zmKxvCh6mUbwR+DiT/wTA1I4aAtQt2lj1KP2Xa5YuFuerRLsktMhda wlGgjT8NgqVvA== Original-Received: from pastel (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 5FD57120172; Sun, 16 Oct 2022 12:05:34 -0400 (EDT) In-Reply-To: <878rlgjcbl.fsf@tcd.ie> (Basil L. Contovounesios's message of "Sun, 16 Oct 2022 13:24:30 +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: , 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:245661 Archived-At: > Further to https://bugs.gnu.org/58531#25, generic functions do not > currently support advertised-calling-convention very well (or vice > versa). > > For example, starting with: > > (cl-defgeneric my-foo (x &optional _y) > "Frobnicate X." > (declare (advertised-calling-convention (x) "29.1")) > x) > > Any code that calls my-foo with two arguments correctly gives rise to a > warning during byte-compilation. > More importantly, if we now do: > > (cl-defmethod my-foo ((x symbol) &optional _y) > "Frobnicate X the symbol." > (declare (advertised-calling-convention (x) "29.1")) > x) > > Then my-foo's symbol-function is overwritten and its entry in > advertised-signature-table is no longer found, so byte-compilation no > longer warns about incorrect usage, and C-h f regresses to displaying: I believe this is now fixed in `master`. > C-h f also shows the expected arglist, but not for methods: > > my-foo is a Lisp closure. > (my-foo X) > Frobnicate X. > This is a generic function. > Implementations: > (my-foo X &optional _Y) > Undocumented Not this, OTOH. > I wonder if cl-defgeneric should be the single source of this function > property, or whether any cl-defmethod should be able to overload it. > Thoughts? The `declare` form on `cl-defmethod`s has been silently ignored until now. So I added a compilation warning when we find such a `declare`. Stefan