From unknown Sat Sep 20 07:50:49 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#58563 <58563@debbugs.gnu.org> To: bug#58563 <58563@debbugs.gnu.org> Subject: Status: 29.0.50; Generic functions and advertised-calling-convention Reply-To: bug#58563 <58563@debbugs.gnu.org> Date: Sat, 20 Sep 2025 14:50:49 +0000 retitle 58563 29.0.50; Generic functions and advertised-calling-convention reassign 58563 emacs submitter 58563 "Basil L. Contovounesios" severity 58563 normal tag 58563 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 06:24:44 2022 Received: (at submit) by debbugs.gnu.org; 16 Oct 2022 10:24:44 +0000 Received: from localhost ([127.0.0.1]:43466 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok0p2-0004UA-7r for submit@debbugs.gnu.org; Sun, 16 Oct 2022 06:24:44 -0400 Received: from lists.gnu.org ([209.51.188.17]:33212) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok0oy-0004U1-Fp for submit@debbugs.gnu.org; Sun, 16 Oct 2022 06:24:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38894) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ok0oy-0001ZY-16 for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2022 06:24:40 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]:43539) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ok0ou-0005fY-Lt for bug-gnu-emacs@gnu.org; Sun, 16 Oct 2022 06:24:39 -0400 Received: by mail-ej1-x633.google.com with SMTP id d26so19068296eje.10 for ; Sun, 16 Oct 2022 03:24:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=H/7i41DZVZT5fZ6zLUa8noAppUlVp083Nfr40bX+xws=; b=e5MQb/+MNAgVUoXV4+xIfnLsLCcfC69m81fCjguoBI/G1/XTte1yzvLou+jbbnvR98 1jA/orLN3IjB/2xV3eKt7G2TXIzQmMioo924IsOKs5Fx1f9HBY/viOBVqg8DQf4Qcpc/ 6/xYpmhRS9FaIDdmGxbZHk87TC6qR0ZcGEdtbtdrhlW6oYQWUtsKDwAPeILg4Y2vm9bF cvtnyYBWeJpXcFNhYpfXDErdeyRZGbrLg8eSM8V+gFbJp2dZd6B4gmFPcGjQvy0ErWiz M0gojRMIuV9riC9Lg401y3yu43WgsHDabah3dgJPZL4Sfm2XG3lwXKNzDOMY+dG1zNha 6CNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=H/7i41DZVZT5fZ6zLUa8noAppUlVp083Nfr40bX+xws=; b=Rv14IAwPrQP6f6guyHnzujtMUhWj0OpdMu0oBxk2zSuMqYNdhSXlP8+3ZQDfTekwnE smaOUXakRvKVJ7RVA+xQUFcExp4VDeb8ArXDW6L3hutEoUEyRz8Vp6tzUB9az5xyH8pN O4IG1IrEIXwDWRvAk2Brs/kYCy+5NgJ5bAkOR68Ze+Ph5Q4CVVLF6j58uUyXzpblKa3/ W/7glgJhk8WZIwV72pTOOzUukVCxms9stqgScO7tUaQt08AfO930f2fUzQLFGv7PRg1B l+5+gO/rSMopLEe2uBDpq3v5XcXuSHkpixq3H594Mhqgoa2R/19RFVnxYsBhkzPO98Fb XSvw== X-Gm-Message-State: ACrzQf2rh9V/Q+L8UXqbnTwX5tRiRc1M9hG2EaphHRBQwWQq/udPW6kS 2cq1EUhWOHdK6Q6O8ptgH7DelH7RSfsUQg== X-Google-Smtp-Source: AMsMyM73jzN0vh5cfSXgUej8dfC5X7OZrlcSlxEH40KI2/PhLEQMv0bIcLWD3DmOZrPo8grVpdETPw== X-Received: by 2002:a17:906:1350:b0:77f:76a7:a0f with SMTP id x16-20020a170906135000b0077f76a70a0fmr4586511ejb.503.1665915872471; Sun, 16 Oct 2022 03:24:32 -0700 (PDT) Received: from localhost ([2a02:587:321f:7e8a:d9:365a:ced1:b3d1]) by smtp.gmail.com with ESMTPSA id kv2-20020a17090778c200b0077e6be40e4asm4440506ejc.175.2022.10.16.03.24.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Oct 2022 03:24:32 -0700 (PDT) From: "Basil L. Contovounesios" To: bug-gnu-emacs@gnu.org Subject: 29.0.50; Generic functions and advertised-calling-convention X-Debbugs-Cc: Stefan Monnier Date: Sun, 16 Oct 2022 13:24:30 +0300 Message-ID: <878rlgjcbl.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=contovob@tcd.ie; helo=mail-ej1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) 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. 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 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: my-foo is a byte-compiled Lisp function. (my-foo X &optional Y) Frobnicate X. This is a generic function. Implementations: (my-foo (X symbol) &optional _Y) Frobnicate X the symbol. (my-foo X &optional _Y) Undocumented Note that, unlike with cl-defgeneric, the declare form in cl-defmethod does not expand to a call to set-advertised-calling-convention. If set-advertised-calling-convention is called after the cl-defmethod, then the advertised-calling-convention is preserved (or rather reinstated), but only until the next cl-defmethod is defined (which could happen in third-party code). I guess either advertised-signature-table should be extended to allow for the nature of generic functions, or cl-defmethod should be taught to preserve such function properties (or both). 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? Thanks, -- Basil In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars) of 2022-10-16 built on tia Repository revision: 07222447b6c9e75b713fe3b3954952fbb0e40c71 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101004 System Description: Debian GNU/Linux bookworm/sid From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 06:30:04 2022 Received: (at control) by debbugs.gnu.org; 16 Oct 2022 10:30:04 +0000 Received: from localhost ([127.0.0.1]:43475 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok0uC-0004ml-0e for submit@debbugs.gnu.org; Sun, 16 Oct 2022 06:30:04 -0400 Received: from mail-ej1-f43.google.com ([209.85.218.43]:36653) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok0u8-0004lk-1F for control@debbugs.gnu.org; Sun, 16 Oct 2022 06:30:02 -0400 Received: by mail-ej1-f43.google.com with SMTP id 13so19139115ejn.3 for ; Sun, 16 Oct 2022 03:29:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=VM8SVtSDgho71bXagmHD4jP4zmP2dQ40yZDk+DeH4yA=; b=K7QCcZSpMatYWriPTCh4YFV1dJmyRptobNSIALj0eByxooUMnlIoHhl+XkYOpBceKY 17VsZYIwxLRv89XLsU9HLgSJRjaWjHSQjmMunRWOWvmdPss5yrHKJLSU0aqDMILB1ieP QCW83H6guJ+wlXuMRlQJrpLDVJu761xOxKo6VIjzQDcE+hy71ty2hVhUnFdesqvPlGy6 JBkEyfwKxrAzjZRFPcPF4eVIxldGqgmdUVXCwIrvCGAmPKa0/qojiwqgo07i+gdI6hRd lBv2fiES60xkl0FOUWGhMfB0BR+ugjC/m2AI0lM/81Z0O5+XZgROo2Hgj0DSgWAwqaZq UsWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=VM8SVtSDgho71bXagmHD4jP4zmP2dQ40yZDk+DeH4yA=; b=3wmdv1jenapAwr9oqGG5fwdTl3eIfEnnVzojLP83+354DNYZ0nUrLMW9FKPGOSEZUs p9S7n2ssS7lZhEEA7QRrvk+zwfKoE86EZcn9SzBjHSGGD6CJgeAeIoxN0gBPDGc3TvJW pxOs51I3WO9sAwuhO1rcITYtFbTJHyQjdaP8+KRKYVcPYuj8GNedDGnKimm5yCAceVI8 su5cN+rdeHWkb664zddkg3eUR01WJ5v/rpZmOVzP+UYhGc0JPm3I8aQQkqfc83HllU4u OKuyGk8AxamEj0UdaTn5OvV745Fzfrpvk8cftrpnqPnd5TUFvBUSihKNAJs7fCtRHAlh uoAA== X-Gm-Message-State: ACrzQf383a2y9StS7AgWKN8ba1RgQUNYQKtGmb/c9sTzwrejTUcnQP81 i7LSlIoMJpSLXJRLO0X5asZ+g56zXtpd2g== X-Google-Smtp-Source: AMsMyM5k+bYalFI80RLNyIyeEyjjki0ITtl7EP0tnfVN2M6dzVJCgUV9ZHTDqAFTJspstUbeVmwXMA== X-Received: by 2002:a17:907:9491:b0:78d:337e:580f with SMTP id dm17-20020a170907949100b0078d337e580fmr4780273ejc.464.1665916193890; Sun, 16 Oct 2022 03:29:53 -0700 (PDT) Received: from localhost ([2a02:587:321f:7e8a:d9:365a:ced1:b3d1]) by smtp.gmail.com with ESMTPSA id v1-20020a170906292100b0078116c361d9sm4516715ejd.10.2022.10.16.03.29.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Oct 2022 03:29:53 -0700 (PDT) From: "Basil L. Contovounesios" To: control@debbugs.gnu.org Subject: control message for bug #58563 Date: Sun, 16 Oct 2022 13:29:51 +0300 Message-ID: <871qr8jc2o.fsf@tcd.ie> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) found 58563 25.3.1 quit From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 06:33:39 2022 Received: (at 58563) by debbugs.gnu.org; 16 Oct 2022 10:33:39 +0000 Received: from localhost ([127.0.0.1]:43480 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok0xe-0004u2-P0 for submit@debbugs.gnu.org; Sun, 16 Oct 2022 06:33:39 -0400 Received: from quimby.gnus.org ([95.216.78.240]:42872) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok0xc-0004to-QF for 58563@debbugs.gnu.org; Sun, 16 Oct 2022 06:33:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=HrJl+3xa7EzYfYMSd9Z4mBasSKskoYiO3Ri2Xpu1Zj8=; b=C8oqWWaokx+9v/To/ZKTFpOneV jQSkvPvSzgboZkZ3R8Q1vEv8CfVzl7Z3Z/oj4RlrHS8kd1pWcxRevwK6A9tk8HXBhrxMucOE2z05W pgBwMV6l0tKMf/UGVgWa/q0azvyxh9nvV3O91LDT00veYw9sO47c493zrLdrQgvAw8S4=; Received: from [84.212.220.105] (helo=downe) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ok0xS-00054a-2I; Sun, 16 Oct 2022 12:33:28 +0200 From: Lars Ingebrigtsen To: 58563@debbugs.gnu.org Subject: Re: bug#58563: 29.0.50; Generic functions and advertised-calling-convention In-Reply-To: <878rlgjcbl.fsf@tcd.ie> (Basil L. Contovounesios's message of "Sun, 16 Oct 2022 13:24:30 +0300") References: <878rlgjcbl.fsf@tcd.ie> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAHlBMVEUeHh4jIyceHiEf ICUlJzUfHyAgIB4nLkAoMEL///+GCEy2AAAAAWJLR0QJ8dml7AAAAAd0SU1FB+YKEAoDBUCwP5sA AAFlSURBVDjLbZRNbgIxDIUDEgd4YLVbSE/QI7iyNHMN7hAJDjCLHrvj2M4PxWIR8vnZjrFJB+yW jvmY8ZVzTjmpXZFQ7ZwBERLBEdfTTX0NgNiA4GwXDkQUVMMIqqtMJLmgK0ZAAagSDkAyKUyTLJAw g8kEeq6A3ItJXGvgw93AnkIieQAIB9m/pAM1QOfqRKyiBnC5kBXi4NRql1KiEgU3r52W5fkollAl 6e4usixFr0KS3Adb1BDAPH5ody8a+3sGmnSpisvnCPYAvIMiK0eHXHE32fYUB+zAfhHa6pEHEG+M Z7wq4tgA38MzOsxDufLbTiN4iKzbJr3cGIXH4gDeRLC/8LfoB13hXZd1Lc/tX3ejmj6ObRhs4jWQ Pp3nKYEviVQQPdEOI8INc2Xv7tPbwWCarM1u1FmPw7QPldqCtP3ogNt+4EXB46oxvwPz1vK85w3w 9AeADjADMKb7DjwR3oBQmv0Btv7fI1gQMg8AAAAldEVYdGRhdGU6Y3JlYXRlADIwMjItMTAtMTZU MTA6MDM6MDUrMDA6MDC3nENBAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIyLTEwLTE2VDEwOjAzOjA1 KzAwOjAwxsH7/QAAAABJRU5ErkJggg== X-Now-Playing: The Knife's _Silent Shout_: "From Off to On" Date: Sun, 16 Oct 2022 12:33:25 +0200 Message-ID: <878rlgjbwq.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: "Basil L. Contovounesios" via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > 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? Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58563 Cc: "Basil L. Contovounesios" , Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) "Basil L. Contovounesios" via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > 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? I think... that this belongs in the cl-defgeneric only, and not in the cl-defmethod. (Unless there isn't a cl-defgeneric, which is sometimes the case.) That is, if a cl-defgeneric has defined a advertised-calling-convention, it should be an error for the cl-defmethod to define one. Perhaps. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 07:10:22 2022 Received: (at 58563) by debbugs.gnu.org; 16 Oct 2022 11:10:22 +0000 Received: from localhost ([127.0.0.1]:43527 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok1XC-0008AF-5P for submit@debbugs.gnu.org; Sun, 16 Oct 2022 07:10:22 -0400 Received: from mail-ej1-f43.google.com ([209.85.218.43]:38749) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok1X6-00089t-Nz for 58563@debbugs.gnu.org; Sun, 16 Oct 2022 07:10:20 -0400 Received: by mail-ej1-f43.google.com with SMTP id fy4so19219576ejc.5 for <58563@debbugs.gnu.org>; Sun, 16 Oct 2022 04:10:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=4aqL8yDoBt5gV4LZZH2SUJ011kNmSXKw3MDtgp1BFnQ=; b=W/vK2IqJp/QfXMfB1gKNAS0kiJ2jS5gf1lQATeh+j7m4E8P4k2R5B5sZMSIVjA1Xu/ n88octtwF3mdM72uYku1CNhBLVeyD1LSEJmzH7NmeJPqhRDZNGroP01Jxc2+m0tei+3x AEaWQeeDEc+3v+oXS904Q+TDYU8lP/e0S2Z2P712E6d10R7NT/cYJ6rN8D5Y//dSuOPy 82jL5xQ2IwJbKNHQXRIFX8pCNU4F4LGYDU42zhYNIk7xtfE5n/XbTEitHwa7xx3RfCyv t13XvRVvvJim23Tdcdy3/k4YigIc7bP3E/TNXZwM/4fUGcQA3GYvH26r3OvTMYs6G4jX dwzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=4aqL8yDoBt5gV4LZZH2SUJ011kNmSXKw3MDtgp1BFnQ=; b=yFuqfb/9m0+brPZ/gQTcRBq9ej3B6SlcXqfRqdJxZAj4VoBvssZv5pReFSSoslmWTM vrx8kBVmBxzZIXKHluulZE8DN9vahIiF/qOxgvUp48uI0pYkt158BQ8eVoJXcpzqBOr/ xUS4qlc5GX45bAn66D1s4A1pFihb3wa4n+merWlnLq03W1Uy8MkSzYKZp68LO6kbbE9g H7Gwbm+nMhgEYscjSNyAUQYxylszHvElyDwzO6eIAL+lvBrsfwNuF2LCiDwCBn7g2/of nPvqR8HbZzQCF0ahs/lz3Z74cmMhGVCDwgmSbXiIgqVCyOfkorKkcwvF7PQ0pKsAfYpe yWTA== X-Gm-Message-State: ACrzQf0x7ZeNJ9lCuWvZUB5pYnjZIr9XWoVc3ih4uiUndpiml5snXNxL cwh4jouhaF9LLs6/2X7BbLm7xUNhbfnZHQ== X-Google-Smtp-Source: AMsMyM5lgLZvEqOzb4Bs04F6rt/ylpx2toNetqvm+nb/bsnCYMgQ58bCjGYJga/aUAgUtvyBSZMGvg== X-Received: by 2002:a17:906:8a55:b0:78d:b6db:a2d4 with SMTP id gx21-20020a1709068a5500b0078db6dba2d4mr4908446ejc.82.1665918610598; Sun, 16 Oct 2022 04:10:10 -0700 (PDT) Received: from localhost ([2a02:587:321f:7e8a:d9:365a:ced1:b3d1]) by smtp.gmail.com with ESMTPSA id r11-20020a170906704b00b0073d9630cbafsm4444223ejj.126.2022.10.16.04.10.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Oct 2022 04:10:10 -0700 (PDT) From: "Basil L. Contovounesios" To: 58563@debbugs.gnu.org Subject: Re: bug#58563: 29.0.50; Generic functions and advertised-calling-convention In-Reply-To: <878rlgjcbl.fsf@tcd.ie> (Basil L. Contovounesios" via "Bug reports for GNU Emacs, the Swiss army knife of text editors's message of "Sun, 16 Oct 2022 13:24:30 +0300") References: <878rlgjcbl.fsf@tcd.ie> Date: Sun, 16 Oct 2022 14:10:08 +0300 Message-ID: <87mt9whvn3.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 58563 Cc: Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Basil L. Contovounesios [2022-10-16 13:24 +0300] wrote: > 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. Except inside ert-deftest, actually. I wonder why? -- Basil From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 10:26:53 2022 Received: (at 58563) by debbugs.gnu.org; 16 Oct 2022 14:26:53 +0000 Received: from localhost ([127.0.0.1]:45858 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok4bM-0003m5-QR for submit@debbugs.gnu.org; Sun, 16 Oct 2022 10:26:53 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:57396) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok4bL-0003lt-8H for 58563@debbugs.gnu.org; Sun, 16 Oct 2022 10:26:51 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id ED54B10013B; Sun, 16 Oct 2022 10:26:45 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 403AD1000D0; Sun, 16 Oct 2022 10:26:44 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1665930404; bh=qZy7J+ztT6dOM1hHAoh8H+DJ56bG8xXJbY4iob/14po=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=DxxfoVTL90TYVPYkS50IXp0PzUOWhH9VyTrkDmPgjrRhj+r0gXkvMuz6l/5iQcpRN Y0RaKk81tpT1b98Q27ZePf3xkm3TSJMLi+NLuvRdfEOvqNxbjW+0ReGQbwH2IKOosu DBn9mCGcIYKNhkn6IcOuL7OamaJPtsJEd4qP9m6xzRRqHE0uWQ6lShixeO26/aySWF tdgMXgZRKmAAz+LOBgzzJxdRkfuVc7bqhy7ZvoYBpicNmWvXWF91TGtkOsFuUsS/78 8RxKyLQ71nD/7o3oGvYoNSgYG2p+XWCOTeKYiadM2BfmarTD2MGppB+/6FmHGRQd4O 9ki3FdRyB0bwg== Received: from pastel (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0DDEA120F15; Sun, 16 Oct 2022 10:26:44 -0400 (EDT) From: Stefan Monnier To: Lars Ingebrigtsen Subject: Re: bug#58563: 29.0.50; Generic functions and advertised-calling-convention In-Reply-To: <878rlgjbwq.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 16 Oct 2022 12:33:25 +0200") Message-ID: References: <878rlgjcbl.fsf@tcd.ie> <878rlgjbwq.fsf@gnus.org> Date: Sun, 16 Oct 2022 10:26:43 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.068 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58563 Cc: "Basil L. Contovounesios" , 58563@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > I think... that this belongs in the cl-defgeneric only, and not in the > cl-defmethod. Agreed. > (Unless there isn't a cl-defgeneric, which is sometimes the case.) I wouldn't bother special casing this. I think it's OK to say that if you want an `advertised-calling-convention` you need to add a `cl-defgeneric`. This likely applies to most other `declare`ations, actually. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 10:28:01 2022 Received: (at 58563) by debbugs.gnu.org; 16 Oct 2022 14:28:01 +0000 Received: from localhost ([127.0.0.1]:45863 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok4cT-0003of-6X for submit@debbugs.gnu.org; Sun, 16 Oct 2022 10:28:01 -0400 Received: from quimby.gnus.org ([95.216.78.240]:45200) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok4cR-0003oN-Ep for 58563@debbugs.gnu.org; Sun, 16 Oct 2022 10:27:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=1KUSsJkbFbv2JX33U3GYlZGwpYMT+6Fj+pZ1wEX9pUs=; b=dA0uZDSF6uPnLZOOfNeYf/lJTP zpzHuY0VfYoKbtMKQ818PENFBh09g3qzGzdWLAN+fQtGQVHTFFBwW0MSU6l2me6MwFNZwZdrwR01m j3N69I4AxSkyzbslgW0R9oF35bo07CcMipTbDuX21M+T150a6RvHPrjyq5T4MV/0G3g0=; Received: from [84.212.220.105] (helo=downe) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ok4cH-00076V-TM; Sun, 16 Oct 2022 16:27:52 +0200 From: Lars Ingebrigtsen To: Stefan Monnier Subject: Re: bug#58563: 29.0.50; Generic functions and advertised-calling-convention In-Reply-To: (Stefan Monnier's message of "Sun, 16 Oct 2022 10:26:43 -0400") References: <878rlgjcbl.fsf@tcd.ie> <878rlgjbwq.fsf@gnus.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEWea2tqUVHQxsf/ //+g2WP3AAAAAWJLR0QDEQxM8gAAAAd0SU1FB+YKEA4XGAoRLMsAAAGWSURBVCjPNZHBitwwDIb/ mE0ZfMphMtA9TQ8LGT3FUprD5jQJ9sLmtMdunsINpIccSx/AE0ix9ZSVPW0CsT5Jln4pAFDb3tqr GCierbUvrbWmLMRtr0aHdPaQDA9La7C2RqHZFVYZXvoCXgW5eTS8guAlwgzD2hGC5vw47Rjr3WbJ kMRfPGdQvCGMvG28sgMNCB3z40YMxAHsOby1U2i/hhFcj/58IJbmDDa0pQKpCniQr9T/EztGtBt/ /ni3/T4ybpaDq2BNitzGexrJCx6zGiAXeGQOXmGhOP6PzMskCqbv97R9ksgU7pAONNleaf0H4pTJ 48Qg5ibD3kUBogw3iXxiPuhGfEEUHMUti8s7koVlAFHskqYEh5iaClQJdrokoJSlZAgxNpFflmkC gtrkTvmE5iJ9lCcp0ABPUwQc/SiVxrBLBE4XrVqLQeRCVVr+4lwMaSECsPNancJLB670fJwZp8W+ IlwTBP/6uz4BVyVw+GKADO7oqve+UT+TLGAxZ9H9LU3icDt5KmOLZyXa4oOn+nL+C+ZB2M5nOnbK AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTEwLTE2VDE0OjIzOjI0KzAwOjAwyxuc3wAAACV0RVh0 ZGF0ZTptb2RpZnkAMjAyMi0xMC0xNlQxNDoyMzoyNCswMDowMLpGJGMAAAAASUVORK5CYII= X-Now-Playing: Dani Siciliano's _Slappers_: "Think Twice" Date: Sun, 16 Oct 2022 16:27:49 +0200 Message-ID: <875ygjj122.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stefan Monnier writes: > I wouldn't bother special casing this. > I think it's OK to say that if you want an > `advertised-calling-convention` you need to add a `cl-defgeneric`. > This likely applies to most other `declare` [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58563 Cc: "Basil L. Contovounesios" , 58563@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier writes: > I wouldn't bother special casing this. > I think it's OK to say that if you want an > `advertised-calling-convention` you need to add a `cl-defgeneric`. > This likely applies to most other `declare`ations, actually. Yes, good point. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 10:49:40 2022 Received: (at 58563) by debbugs.gnu.org; 16 Oct 2022 14:49:40 +0000 Received: from localhost ([127.0.0.1]:45871 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok4xQ-0004PM-AD for submit@debbugs.gnu.org; Sun, 16 Oct 2022 10:49:40 -0400 Received: from quimby.gnus.org ([95.216.78.240]:45706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok4xP-0004P9-BQ for 58563@debbugs.gnu.org; Sun, 16 Oct 2022 10:49:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=MVgAOZ5+IAOK2bVWIY1UpZYwSIb9FKP+YMtreJ0Rznw=; b=g34rGLZpN+OswWDPEQDhP+ZPCa uFNKWDHm0q9aUQRCrIyZZLaNI9vOU+Y3AZf6ecWNLERpnxAQ6xBEbxgRGPI70ovq07oe2oWeIpN/K 55kySBCbEPTVIRMzeyC0DE4N+BKn/chQ6fbuvRCpaEo/zc1b6o1magH2xvwZsj3bmGiY=; Received: from [84.212.220.105] (helo=downe) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ok4xF-0007Lf-Bu; Sun, 16 Oct 2022 16:49:31 +0200 From: Lars Ingebrigtsen To: Stefan Monnier Subject: Re: bug#58563: 29.0.50; Generic functions and advertised-calling-convention In-Reply-To: <875ygjj122.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 16 Oct 2022 16:27:49 +0200") References: <878rlgjcbl.fsf@tcd.ie> <878rlgjbwq.fsf@gnus.org> <875ygjj122.fsf@gnus.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEX39vZbTkmroJ3/ //8oMz/yAAAAAWJLR0QDEQxM8gAAAAd0SU1FB+YKEA4tCDIP4tYAAAGHSURBVCjPrZGxbtswEIZ/ E7BheUqDOLA3wYgKy0+hZvOmQXcQOalFZUB+Ci0BnE5CUQpxJqUoA1lP2aNc5Al6A48f+N9/RxIz ffh2HoZWH1yCHbUFFoO7lJcUMesa6nIstckQmarGXJE2nCM6H4Cgjpkpxz0dQsTJ1pLNsKQ/4Tzq +yWVHl6wCH4nkaYrqPdqMaUR8rk6nuLnqyzdhj82pMnlXtb2uzciehbQmvhiBarMgxWNhPUyQ+OW jh60Lomco1yA6cue6X3JMuiayVgelTnOPhnvpnNIsnZ4/QDDfWvtOJum0vSDq1hOAunDQ+SLMigB M8RudPONeLPzUMhjWDLGDtKiBmDb2h3V2atEJ2N8x5qKENP09QGbE35ScoN7lQTdqZsU21WDJoBq HlaqxmyPYiVln+9kURkeO+/xS5ZJioolf2LUiGaw8gm4rdCgU1hbgW6Pu7cE+CoyVU/cE/mycuAp JsS9NzSUrQQcxrD5jcDjFaZpA8XdFRDJrfrwH6ga/yn+Agg7kG2aHvR7AAAAJXRFWHRkYXRlOmNy ZWF0ZQAyMDIyLTEwLTE2VDE0OjQ1OjA4KzAwOjAwqzVL0gAAACV0RVh0ZGF0ZTptb2RpZnkAMjAy Mi0xMC0xNlQxNDo0NTowOCswMDowMNpo824AAAAASUVORK5CYII= X-Now-Playing: Gang Gang Dance's _God's Monkey_: "(untitled)" Date: Sun, 16 Oct 2022 16:49:28 +0200 Message-ID: <871qr7j01z.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen writes: >> I wouldn't bother special casing this. >> I think it's OK to say that if you want an >> `advertised-calling-convention` you need to add a `cl-defgeneric`. >> This likely applies to most other `decl [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58563 Cc: "Basil L. Contovounesios" , 58563@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Lars Ingebrigtsen writes: >> I wouldn't bother special casing this. >> I think it's OK to say that if you want an >> `advertised-calling-convention` you need to add a `cl-defgeneric`. >> This likely applies to most other `declare`ations, actually. > > Yes, good point. On the other hand, thinking about this a bit more -- it's not an uncommon thing to just use defmethod to without a defgeneric to just ensure that you're calling the function with arguments of the right type. Making people add a fallback method (to error out on) would just be pointless noise for them. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 11:09:05 2022 Received: (at 58563) by debbugs.gnu.org; 16 Oct 2022 15:09:05 +0000 Received: from localhost ([127.0.0.1]:45886 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok5GD-0004w4-4k for submit@debbugs.gnu.org; Sun, 16 Oct 2022 11:09:05 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:35283) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok5GB-0004va-JP for 58563@debbugs.gnu.org; Sun, 16 Oct 2022 11:09:04 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id D3BAC10013B; Sun, 16 Oct 2022 11:08:57 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 8DD6B1000D0; Sun, 16 Oct 2022 11:08:56 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1665932936; bh=sPkq1yTtWmdADfPRlOYBfGbPu94rMBHJJazEHP2Xekg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=lq4emY2oTaaTfmOGHjyKBnOPLXwFfqibl3Tjho4HZ7RbkPNu5BfshX/uW2psuDEuG zjZUXfxDKQEjhBxtEzRhG6v+VZS81Eyyp/x1q97WC/1momRCEIVVHA7ixsR97ZmhUI 94TCc3HySU818GP+LHNYVgiKmrWutGDQq43IUa6gWDkO6xwR/0g7s8RYpyqmBUtMe2 +lDxUaM/Ot7vddmVeunUY/YgpdQbn/ASGdPK34v+/rhvEuHCoxLOXqdt9VFKpQOMVs qHzTLUKQlsqq7JQY33h/9CEUW60D3O0XaiRocmRaFz1u9+IxKFqBhqYtKfSVeXzgES N0DKfWOtDQb8A== Received: from pastel (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 3049812068A; Sun, 16 Oct 2022 11:08:56 -0400 (EDT) From: Stefan Monnier To: Lars Ingebrigtsen Subject: Re: bug#58563: 29.0.50; Generic functions and advertised-calling-convention In-Reply-To: <871qr7j01z.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 16 Oct 2022 16:49:28 +0200") Message-ID: References: <878rlgjcbl.fsf@tcd.ie> <878rlgjbwq.fsf@gnus.org> <875ygjj122.fsf@gnus.org> <871qr7j01z.fsf@gnus.org> Date: Sun, 16 Oct 2022 11:08:54 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.067 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58563 Cc: "Basil L. Contovounesios" , 58563@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >>> I wouldn't bother special casing this. >>> I think it's OK to say that if you want an >>> `advertised-calling-convention` you need to add a `cl-defgeneric`. >>> This likely applies to most other `declare`ations, actually. >> >> Yes, good point. > > On the other hand, thinking about this a bit more -- it's not an > uncommon thing to just use defmethod to without a defgeneric to just > ensure that you're calling the function with arguments of the right > type. Making people add a fallback method (to error out on) would just > be pointless noise for them. A defgeneric without a body is *not* a fallback method. It's just a declaration, really. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 11:16:40 2022 Received: (at 58563) by debbugs.gnu.org; 16 Oct 2022 15:16:40 +0000 Received: from localhost ([127.0.0.1]:45892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok5NY-00058R-2X for submit@debbugs.gnu.org; Sun, 16 Oct 2022 11:16:40 -0400 Received: from quimby.gnus.org ([95.216.78.240]:45882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok5NW-00058C-7F for 58563@debbugs.gnu.org; Sun, 16 Oct 2022 11:16:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=k3EJpgAjfuUECxoeNX1jXhueFEGZFgZdIC4L80JWo7M=; b=mMJxV6VOTA9XriZtWAtqGcM3I0 7+lihOSgnw/n+fWsWw6m7FNBw6dI+MMpT84/CQnNxG7Bao17khGevSMXRsEbjtJGNjZ6TbmFBb0Dx U9slSSUGO6rbx22RLNWiNLUD14w/bq7mcjBBJhyMUc+tAPDfKYGPigkAjsdPnKAGe+0M=; Received: from [84.212.220.105] (helo=downe) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ok5NM-0007Wj-Bn; Sun, 16 Oct 2022 17:16:30 +0200 From: Lars Ingebrigtsen To: Stefan Monnier Subject: Re: bug#58563: 29.0.50; Generic functions and advertised-calling-convention In-Reply-To: (Stefan Monnier's message of "Sun, 16 Oct 2022 11:08:54 -0400") References: <878rlgjcbl.fsf@tcd.ie> <878rlgjbwq.fsf@gnus.org> <875ygjj122.fsf@gnus.org> <871qr7j01z.fsf@gnus.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEX39vZbTkmroJ3/ //8oMz/yAAAAAWJLR0QDEQxM8gAAAAd0SU1FB+YKEA4tCDIP4tYAAAGHSURBVCjPrZGxbtswEIZ/ E7BheUqDOLA3wYgKy0+hZvOmQXcQOalFZUB+Ci0BnE5CUQpxJqUoA1lP2aNc5Al6A48f+N9/RxIz ffh2HoZWH1yCHbUFFoO7lJcUMesa6nIstckQmarGXJE2nCM6H4Cgjpkpxz0dQsTJ1pLNsKQ/4Tzq +yWVHl6wCH4nkaYrqPdqMaUR8rk6nuLnqyzdhj82pMnlXtb2uzciehbQmvhiBarMgxWNhPUyQ+OW jh60Lomco1yA6cue6X3JMuiayVgelTnOPhnvpnNIsnZ4/QDDfWvtOJum0vSDq1hOAunDQ+SLMigB M8RudPONeLPzUMhjWDLGDtKiBmDb2h3V2atEJ2N8x5qKENP09QGbE35ScoN7lQTdqZsU21WDJoBq HlaqxmyPYiVln+9kURkeO+/xS5ZJioolf2LUiGaw8gm4rdCgU1hbgW6Pu7cE+CoyVU/cE/mycuAp JsS9NzSUrQQcxrD5jcDjFaZpA8XdFRDJrfrwH6ga/yn+Agg7kG2aHvR7AAAAJXRFWHRkYXRlOmNy ZWF0ZQAyMDIyLTEwLTE2VDE0OjQ1OjA4KzAwOjAwqzVL0gAAACV0RVh0ZGF0ZTptb2RpZnkAMjAy Mi0xMC0xNlQxNDo0NTowOCswMDowMNpo824AAAAASUVORK5CYII= X-Now-Playing: Gang Gang Dance's _God's Monkey_: "(untitled)" Date: Sun, 16 Oct 2022 17:16:27 +0200 Message-ID: <87wn8zhk8k.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stefan Monnier writes: > A defgeneric without a body is *not* a fallback method. > It's just a declaration, really. Er, right. Geez, it's been too long since I've written Common Lisp... Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58563 Cc: "Basil L. Contovounesios" , 58563@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier writes: > A defgeneric without a body is *not* a fallback method. > It's just a declaration, really. Er, right. Geez, it's been too long since I've written Common Lisp... But still, having to use a defgeneric to do `declare's is a bit cumbersome. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 11:35:15 2022 Received: (at 58563) by debbugs.gnu.org; 16 Oct 2022 15:35:15 +0000 Received: from localhost ([127.0.0.1]:45906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok5fW-0005df-Qw for submit@debbugs.gnu.org; Sun, 16 Oct 2022 11:35:15 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:36323) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ok5fV-0005dL-0n for 58563@debbugs.gnu.org; Sun, 16 Oct 2022 11:35:13 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 31645805B2; Sun, 16 Oct 2022 11:35:07 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id BEB9A80261; Sun, 16 Oct 2022 11:35:01 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1665934501; bh=v/kjKJTYLpLBa8nDLM7Jb4PSqncBlWSiyxxFzOJynsw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=YZpe88aAbh+HoIUqhvE9OJxv/Fhdwu0H3Is56QkexrrETtvhLbTWhj84DLmLT8f0V QlWXFyap5Ih6Hx74I3KrJj8aFfZbwj9ucPXGdwNYDSNkOXqypP8Qt/ruUptB/t/kCS lOpR5JPjJxWFQc3YORlwJwSFx+F6g0X7Z9vomW9l/G/QApN2/rg969e2TXgxpDNynI miFIB2yLWmmnlzjY/03rp6xXDe5oqiTUcEAWUzyAZm7banLNJUekmEHC5VEQhdpH3p 7EJHcJT6ZpXV+pGOvMCAykoovArb+Pi5bkhDJdo6dTmew5GB8piPIg970/7RDAMDOU admsbXtRMtHng== Received: from pastel (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7A3AF120F35; Sun, 16 Oct 2022 11:35:01 -0400 (EDT) From: Stefan Monnier To: Lars Ingebrigtsen Subject: Re: bug#58563: 29.0.50; Generic functions and advertised-calling-convention In-Reply-To: <87wn8zhk8k.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 16 Oct 2022 17:16:27 +0200") Message-ID: References: <878rlgjcbl.fsf@tcd.ie> <878rlgjbwq.fsf@gnus.org> <875ygjj122.fsf@gnus.org> <871qr7j01z.fsf@gnus.org> <87wn8zhk8k.fsf@gnus.org> Date: Sun, 16 Oct 2022 11:35:00 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.124 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58563 Cc: "Basil L. Contovounesios" , 58563@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Lars Ingebrigtsen [2022-10-16 17:16:27] wrote: > Stefan Monnier writes: >> A defgeneric without a body is *not* a fallback method. >> It's just a declaration, really. > Er, right. Geez, it's been too long since I've written Common Lisp... > But still, having to use a defgeneric to do `declare's is a bit > cumbersome. The need for `declare` is infrequent. The use of a single `cl-defmethod` is infrequent. The intersection of the two should be small enough that I don't see a good reason to care if it's slightly less convenient than ideal. But I'm only arguing to defend my choice not to implement it: don't let that stop you from doing the work :-) Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 16 12:05:48 2022 Received: (at 58563) by debbugs.gnu.org; 16 Oct 2022 16:05:48 +0000 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 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 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) 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== 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) From: Stefan Monnier To: "Basil L. Contovounesios" Subject: Re: bug#58563: 29.0.50; Generic functions and advertised-calling-convention In-Reply-To: <878rlgjcbl.fsf@tcd.ie> (Basil L. Contovounesios's message of "Sun, 16 Oct 2022 13:24:30 +0300") Message-ID: References: <878rlgjcbl.fsf@tcd.ie> Date: Sun, 16 Oct 2022 12:05:33 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.124 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain KAM_SHORT 0.001 Use of a URL Shortener for very short URL X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58563 Cc: 58563@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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 From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 23 13:16:08 2022 Received: (at 58563) by debbugs.gnu.org; 23 Oct 2022 17:16:08 +0000 Received: from localhost ([127.0.0.1]:46438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omeZz-0007IR-Sz for submit@debbugs.gnu.org; Sun, 23 Oct 2022 13:16:08 -0400 Received: from mail-ed1-f45.google.com ([209.85.208.45]:42579) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omeZv-0007HU-Dc for 58563@debbugs.gnu.org; Sun, 23 Oct 2022 13:16:06 -0400 Received: by mail-ed1-f45.google.com with SMTP id y12so3131102edc.9 for <58563@debbugs.gnu.org>; Sun, 23 Oct 2022 10:16:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=+rMwsufGVQ1RW5tWUfpbapYb0qRCNpfpPTBUEhKn+C0=; b=UYxaxyjAknenmAQyq5ni9TYjovXUFJD9Prlw8xwvvuvUnsLpX1Uzidm+7Dj85yNZym f8Eh/6kiu0wLzbzl39U4XwrqnvnNZeHgtW6VE5pl33GmbEcIwzO580R2qj7HIKUcd8rq ywqoq+9BHPNwAB2K8N2oV15fMj6OFfaOIihZFuqb7Ec8SNtDWVS1jtx/ZqX1+bE0Je0/ udExdac4gnrCPXz+TIdV4eQza1VxATFopRlGpzMlpsYJ5Jamc7ucAvd8WmSsaQe37wjd 17R2i4BVCWba85utcde4wO2vuajoge8ZgCn6gi8s6SKNmo8in61FFpljUSUgBs+m7089 SsVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+rMwsufGVQ1RW5tWUfpbapYb0qRCNpfpPTBUEhKn+C0=; b=mVADpbnm8PD1Fz/xeD5hJfYYYkRQAZhUXDH8XNIqJeA8iv0UHUXqj5Y5PhAc8YP+xz gtqhGa4jsUSRWH0KeIBCzkLUNzE213T+McvktkUbjbuhGFuDXjbUkjfLTx+7tU47TMr2 m/oHJv5ih3XZGcyfbPjHFno6b/k7NuNNbttn/0Q3NNtLNUEag//gj1Yltqf4hQIj6vwY P4gZJNQ/guBKi/XLkPH2En9zAnDjJ2AEEHeGteDBnYspIt2Z1DLxQG5THOapiWcIXKE2 TW9hGR48eNkoksfdYuIFsboRabDYszRnHlMM1jqUa8Uod2kENVpXArr4EmYFtHIzewFs JdyQ== X-Gm-Message-State: ACrzQf1g4Rj4J50EeekhyD+wrRU8Q1lXzDxaf1C1fUFAldQMxf/PqIHW B5sdP8Ow0G4V5q2TLkQmlwkcEZsmVidWGA== X-Google-Smtp-Source: AMsMyM6BTnGqvjdxkqEaG+ND50qo+F6yK0h7BaKS5fBXtqALEWyR/oBMbOG+G0AsZiQygSderl2O9g== X-Received: by 2002:a17:907:6ea9:b0:794:8b93:2e44 with SMTP id sh41-20020a1709076ea900b007948b932e44mr19199732ejc.407.1666545357322; Sun, 23 Oct 2022 10:15:57 -0700 (PDT) Received: from localhost ([2a02:587:321f:7e8a:d9:365a:ced1:b3d1]) by smtp.gmail.com with ESMTPSA id p10-20020a170906228a00b0078bfe57fc7bsm14208029eja.47.2022.10.23.10.15.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 10:15:56 -0700 (PDT) From: "Basil L. Contovounesios" To: Stefan Monnier Subject: Re: bug#58563: 29.0.50; Generic functions and advertised-calling-convention In-Reply-To: (Stefan Monnier's message of "Sun, 16 Oct 2022 12:05:33 -0400") References: <878rlgjcbl.fsf@tcd.ie> Date: Sun, 23 Oct 2022 20:15:55 +0300 Message-ID: <87czaih35g.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 58563 Cc: 58563@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable tags 58563 + patch quit Stefan Monnier [2022-10-16 12:05 -0400] wrote: >> 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. Do we want this fixed? 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=98map.= 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 So the generic docstring shows the advertised signature, and the method docstrings show the actual signature. Whereas with a patch like that following my signature, we'd have: 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) in =E2=80=98map.el=E2=80=99. Return non-nil if MAP contains KEY, ignoring TESTFN. (map-contains-key (MAP array) KEY) 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) 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) in =E2=80=98map.el=E2=80=99. Undocumented I don't know whether that's better or worse, with all the references to the seemingly nonexistent TESTFN. Then again, we could just update the docstrings to mention it less. WDYT? P.S. There's a call to cl--generic-method-info also in elisp-mode.el. I wasn't sure whether the advertised signature is of use there, so I left it alone. --=20 Basil --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=signature.diff diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el index 7b6d43e572..db1ad64874 100644 --- a/lisp/emacs-lisp/cl-generic.el +++ b/lisp/emacs-lisp/cl-generic.el @@ -484,18 +484,18 @@ cl-generic-define-context-rewriter (defun cl--generic-make-defmethod-docstring () ;; FIXME: Copy&paste from pcase--make-docstring. (let* ((main (documentation (symbol-function 'cl-defmethod) 'raw)) - (ud (help-split-fundoc main 'cl-defmethod))) + (ud (help-split-fundoc main 'cl-defmethod)) + (generic (cl--generic 'cl-generic-generalizers))) ;; So that eg emacs -Q -l cl-lib --eval "(documentation 'pcase)" works, ;; where cl-lib is anything using pcase-defmacro. (require 'help-fns) (with-temp-buffer (insert (or (cdr ud) main)) (insert "\n\n\tCurrently supported forms for TYPE:\n\n") - (dolist (method (reverse (cl--generic-method-table - (cl--generic 'cl-generic-generalizers)))) - (let* ((info (cl--generic-method-info method))) + (dolist (method (reverse (cl--generic-method-table generic))) + (let ((info (cl--generic-method-info method generic))) (when (nth 2 info) - (insert (nth 2 info) "\n\n")))) + (insert (nth 2 info) "\n\n")))) (let ((combined-doc (buffer-string))) (if ud (help-add-fundoc-usage combined-doc (car ud)) combined-doc))))) @@ -1096,15 +1096,19 @@ cl--generic-find-defgeneric-regexp (add-to-list 'find-function-regexp-alist '(cl-defgeneric . cl--generic-find-defgeneric-regexp))) -(defun cl--generic-method-info (method) +(defun cl--generic-method-info (method &optional generic) (let* ((specializers (cl--generic-method-specializers method)) (qualifiers (cl--generic-method-qualifiers method)) (call-con (cl--generic-method-call-con method)) (function (cl--generic-method-function method)) - (args (help-function-arglist (if (not (eq call-con 'curried)) - function - (funcall function #'ignore)) - 'names)) + (signature (and generic + (get-advertised-calling-convention + (symbol-function (cl--generic-name generic))))) + (args (if (and generic (listp signature)) signature + (help-function-arglist (if (not (eq call-con 'curried)) + function + (funcall function #'ignore)) + 'names))) (docstring (documentation function)) (qual-string (if (null qualifiers) "" @@ -1154,8 +1158,8 @@ cl--generic-describe (insert (propertize "Implementations:\n\n" 'face 'bold)) ;; Loop over fanciful generics (dolist (method (cl--generic-method-table generic)) - (pcase-let* - ((`(,qualifiers ,args ,doc) (cl--generic-method-info method))) + (pcase-let ((`(,qualifiers ,args ,doc) + (cl--generic-method-info method generic))) ;; FIXME: Add hyperlinks for the types as well. (let ((print-quoted nil) (quals (if (length> qualifiers 0) @@ -1227,7 +1231,7 @@ cl--generic-method-documentation (dolist (method (cl--generic-method-table generic)) (when (cl--generic-specializers-apply-to-type-p (cl--generic-method-specializers method) type) - (push (cl--generic-method-info method) docs)))) + (push (cl--generic-method-info method generic) docs)))) docs)) (defun cl--generic-method-files (method) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 24 15:50:31 2022 Received: (at 58563) by debbugs.gnu.org; 24 Oct 2022 19:50:31 +0000 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 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 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) 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== 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) From: Stefan Monnier To: "Basil L. Contovounesios" Subject: Re: bug#58563: 29.0.50; Generic functions and advertised-calling-convention In-Reply-To: <87czaih35g.fsf@tcd.ie> (Basil L. Contovounesios's message of "Sun, 23 Oct 2022 20:15:55 +0300") Message-ID: References: <878rlgjcbl.fsf@tcd.ie> <87czaih35g.fsf@tcd.ie> Date: Mon, 24 Oct 2022 15:50:18 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.000 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58563 Cc: 58563@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> 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 From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 26 09:51:32 2022 Received: (at 58563) by debbugs.gnu.org; 26 Oct 2022 13:51:32 +0000 Received: from localhost ([127.0.0.1]:53764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ongoe-0001Mf-1T for submit@debbugs.gnu.org; Wed, 26 Oct 2022 09:51:32 -0400 Received: from mail-ej1-f52.google.com ([209.85.218.52]:42717) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ongoc-0001MQ-Fs for 58563@debbugs.gnu.org; Wed, 26 Oct 2022 09:51:31 -0400 Received: by mail-ej1-f52.google.com with SMTP id y14so21402232ejd.9 for <58563@debbugs.gnu.org>; Wed, 26 Oct 2022 06:51:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=0zIslccToWiR0tHb+5lQjop6++LrxJMmqpyf61oHUjc=; b=dDaldjjJN6cfUcaNdipgVPfxxHAUPEVxaal5iUxldBpAuwRkNmHaY4RWoQCThUVxEW TPtTt4jW/iu9UmQMSYgYvUFjfXe3IaUaYBZ8p8+hV8R0ypdZOV+XlBMrKLaChoQmX8MH 91sc5YV0nRwt+HrvJxk7u691SjxzLIz4GN5G7gIZQg9ujb4NruAxU74+UPKbyiy9aNZp 6nNKhlL7alF+CYyy2JoH2i19cq6ipZ8Z/Y7MhYLULa2wqoU21ZGTM7ogz/Fg4+GOnurZ LUSE+u2dnp1V3UFhdt16x2DpJYgzuWIdBShTuzlw1bnrJr5KosFPv6VH9WGW0k+lvVYB 0qTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0zIslccToWiR0tHb+5lQjop6++LrxJMmqpyf61oHUjc=; b=Dzl+etxCxacm40RCimxJrr1SPDz/QqnZSR26b6AiDYmxY9MsONse3K1X6Uwv5vbTrI zIjlOBeRg5o77eygg1xjNxPWptZ2zjRXkBmI377k5Pw7lBAg0kn6B9a7soIjgpvH8X8g 96a/M0Pl3zabbOIdLXWOsH7w42Q06uzQsKazLqzHBC0ok4jzDP771+kJiGR3SCnlMQOy uiSqT3CCbFBPXDYobqudg0FEduwdLqPsqd/tGRYv9Ki0eDMfaQbzjCPvQZBv7PHsGcc0 Vb9B33QOF8qhnycbvDET+5QbMDOlX1mN2h3JBkdetgr3ovChcGdwscoJsJdliqHEif2D +6Rg== X-Gm-Message-State: ACrzQf2Sye0W0hio7ZPV0ojjKrQbHAraSXliWL1u/EDvaCyPiy+jD/Fm 5LGioHra4boiI38+bXyEDcgPhg== X-Google-Smtp-Source: AMsMyM6qwPkrn6G89+TDYL66UxY+kjO2pCoODdM2tkd5l3u8T/U2ihUq6k6msGWUc/RSgyKGakOC9A== X-Received: by 2002:a17:907:e93:b0:78d:46ae:cf61 with SMTP id ho19-20020a1709070e9300b0078d46aecf61mr36768955ejc.579.1666792284584; Wed, 26 Oct 2022 06:51:24 -0700 (PDT) Received: from localhost ([2a02:587:320c:8829:23:8156:16ed:40c2]) by smtp.gmail.com with ESMTPSA id m8-20020a509308000000b0045bd257b307sm3536823eda.22.2022.10.26.06.51.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 06:51:24 -0700 (PDT) From: "Basil L. Contovounesios" To: Stefan Monnier Subject: Re: bug#58563: 29.0.50; Generic functions and advertised-calling-convention In-Reply-To: (Stefan Monnier's message of "Mon, 24 Oct 2022 15:50:18 -0400") References: <878rlgjcbl.fsf@tcd.ie> <87czaih35g.fsf@tcd.ie> Date: Wed, 26 Oct 2022 16:51:22 +0300 Message-ID: <874jvqsnfp.fsf@tcd.ie> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58563 Cc: 58563@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier [2022-10-24 15:50 -0400] wrote: > 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. Agreed. So is there something left to be done here, or can this bug be closed? Thanks, -- Basil From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 26 10:45:40 2022 Received: (at 58563-done) by debbugs.gnu.org; 26 Oct 2022 14:45:41 +0000 Received: from localhost ([127.0.0.1]:55057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1onhf2-00030L-Lj for submit@debbugs.gnu.org; Wed, 26 Oct 2022 10:45:40 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:39055) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1onhex-000303-C0 for 58563-done@debbugs.gnu.org; Wed, 26 Oct 2022 10:45:39 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id A6765807AF; Wed, 26 Oct 2022 10:45:29 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 3D7D9803F0; Wed, 26 Oct 2022 10:45:28 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1666795528; bh=6YracGDvrzOIBpEEOXUYZXYk4sFEjOvOYtRMb2eqa5Y=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=MqL10LdiiGlOtMHYwXybCWBREkQE5UaOWcPQRwS4MAiShGqXvVwKhM5x9fz6nyzXc lP8jM0QX9cw0KJlWMrcu1AG/RxhYbf9ekSuFWJit0qGgTiJBAg4SGp4XF5EbLLt8V0 MOGW3SGLHgsmQlNQp5K2IPiwwamsmtLSn0xWYv7I+1+xV7Nnj4aB17JKK2koWtNqgF 96qWda792RueHoEbfzIcijG2ztfvCrm7rLpgJPZ/1krBWgJ/QNZmwSxEie8HpivvYn PdsHX4HAQb0vo1gU9L6tSPujxdQ7hhohc63b0iMj8+4VMbTTRheVYnnxRzB+T87CZi MLPwiVvX/luKw== Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1D034120F94; Wed, 26 Oct 2022 10:45:28 -0400 (EDT) From: Stefan Monnier To: "Basil L. Contovounesios" Subject: Re: bug#58563: 29.0.50; Generic functions and advertised-calling-convention In-Reply-To: <874jvqsnfp.fsf@tcd.ie> (Basil L. Contovounesios's message of "Wed, 26 Oct 2022 16:51:22 +0300") Message-ID: References: <878rlgjcbl.fsf@tcd.ie> <87czaih35g.fsf@tcd.ie> <874jvqsnfp.fsf@tcd.ie> Date: Wed, 26 Oct 2022 10:45:13 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.604 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58563-done Cc: 58563-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Basil L. Contovounesios [2022-10-26 16:51:22] wrote: > Agreed. So is there something left to be done here, or can this bug be > closed? Let's see... Stefan From unknown Sat Sep 20 07:50:49 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 24 Nov 2022 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator