GNU bug report logs - #50219
28.0.50; Provide better errors when trying to specialize on optional args in generic methods

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Eric Abrahamsen <eric@HIDDEN>; dated Thu, 26 Aug 2021 23:12:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 50219 <at> debbugs.gnu.org:


Received: (at 50219) by debbugs.gnu.org; 29 Aug 2021 19:17:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Aug 29 15:17:14 2021
Received: from localhost ([127.0.0.1]:57404 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mKQIo-0000G9-Jp
	for submit <at> debbugs.gnu.org; Sun, 29 Aug 2021 15:17:14 -0400
Received: from mout.web.de ([212.227.17.11]:51801)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1mKQIj-00007i-Rx
 for 50219 <at> debbugs.gnu.org; Sun, 29 Aug 2021 15:17:09 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de;
 s=dbaedf251592; t=1630264607;
 bh=V7MK6ocSi5BN0WpvgaRMvTdnUyxoldSvkWbyTUQBJU4=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To;
 b=MMSLBIfEusLgO4hcj8fwf0s1JiP1H2+OLhCOMmuLfrzFQrwvR/P8bndXTmdrZ5ABg
 +b1JrJlnfudKytDBe+wIpnoVShtqmUsQ396oJkyBQdLQqqc2b03PfwM7A3snvdBfnu
 DHt3Ly9bQAjHkaHhLkj1CNCPaNQNPBJHp80hq3zw=
X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9
Received: from drachen.dragon ([88.66.201.155]) by smtp.web.de (mrweb103
 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lo0dI-1mveqt1GtE-00g1tb; Sun, 29
 Aug 2021 21:16:47 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Eric Abrahamsen <eric@HIDDEN>
Subject: Re: bug#50219: 28.0.50; Provide better errors when trying to
 specialize on optional args in generic methods
References: <87k0k7by2w.fsf@HIDDEN> <87bl5ju3me.fsf@HIDDEN>
 <87pmtzpta7.fsf@HIDDEN>
 <jwvczpxll10.fsf-monnier+emacs@HIDDEN> <871r6dimlb.fsf@HIDDEN>
 <jwvmtp1jzh0.fsf-monnier+emacs@HIDDEN> <87wno5h4sy.fsf@HIDDEN>
 <jwvy28lii82.fsf-monnier+emacs@HIDDEN>
 <87fsutkrfz.fsf@HIDDEN> <874kb8sdz6.fsf@HIDDEN>
 <874kb8l0lc.fsf@HIDDEN>
Date: Sun, 29 Aug 2021 21:16:44 +0200
In-Reply-To: <874kb8l0lc.fsf@HIDDEN> (Eric Abrahamsen's message of
 "Sun, 29 Aug 2021 08:41:51 -0700")
Message-ID: <875yvof4df.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:eeNAwL6eJLlS8ukdbrwoL0r8rRh8XJ4Evcfe1hR59xO/u93QEjL
 i/8SRLVb7awH0Jtzc0qyvg7JiJe14mkrlGJzeQSpadOGZ6gg+s7Dvr5XRnUS5QMdrbI01RJ
 Hi15iBbfsWFRA033dgqHfw7orgiRcLGwtW7kHm2SPV+p1gluZDZvVMkPiDMqOZcjVQ6GwJG
 f9iNVEF9l//HoVRSnioow==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:t+FZJ/IVSAI=:9JvZNGuBja/BFXJ4ZOmd3G
 Y9XH2MeuGolh3dctMnreeyvx3JfmtyCzlaL+ZVQ4m4MLbjo3twBMOL1tR+iiTQYJraDs/GvR9
 ecYJyZj0S1i7Dzom76wVYPNteRBYl1AUY9iN2w5JqCDQ4VVkEN0sz9PrDoLPMJcbXTg7b/v54
 zV3nPRA464MjAOr40Y6Dg95fPK3fHORgn9eokh/4WLO5BBlDlhp2FAx3cT2bD8T0YODGcSRh2
 bNaLgafyKbfnrVDcyL0SoW/lGloaAAGGJ5YdcB97ktfcfmk9L7ZySbfxPvN4vStzodMej0ykF
 /6xVgPGXhWg0SsOaueeZSypv1lfbiicBLBP1BqWpjO/PJ6+zXl6misEsAu8LdLGyelt0OTJaL
 JuAdlt9P0vjLH/8mLr2+2N+b82YSQR1CeuzOLMF7o7hlcBG4LdYOuSrMwM7D+QWyjYLmkUT3u
 uPtFkr+TX8hoC5n0NgFKzM0Hg2VULC2K5KUijRucB97uVzdp3d9Le7cCK9seVuMBubJceI9g9
 9Cvfx1ttqCuCCW4Np5nvD16F+hvIW5fq0MUz2m6YWz+wrSsDC0Ktd0K13ATXIJzrEAWvr3SJ/
 sPGBWKtwhkMBNOxK7yv519XgHGsY+TXMgrpxs7rWFgPe2xivuwW5im7aCWhnKx8eQHdemryUX
 Qn+xDjzFXBKPSYyCZYvN0DT/cK8FY7qLE+wafaEspQk+FOjaTuUGubB4hDSxz+Dn53mTYNEHR
 dQBIq7bgg4/zKaZwAtRz4xlCmW/2/SYVfc/CfzUrP5hUrjmcMdxH9rqfbqpAjYgt3PbjYYVoR
 nZaRQVzE5FOLECP9pJLfic9pG/3nHyiQ5xhyKUAw/TZuYXd8ZfgSPTmLa1XZX9sf4V+TaLQXT
 ITyFs+R0vMw+czVcJSAvWf1zJylLyQT+3kvDNBlGOKnw2uBN7t/rJhwMutPBY4+JD2Xhh8CdA
 ETpk2w1AYaw/HnTBGr3tdfBpOpnF7TC4wWzVQiqWZzh8otUlomt/u+oTvWc36QKKYGaq1v7RN
 pqueTnBLfZx87ggOI5Tz56g1KWzqETdY022U3G6KdIZP+5MYB7JhEsYZxRW4BK4jEuHs6ZZzO
 Pin1lyUCNHd10bGTuJKHPBVYVE8GVz4ZAwaX1BpJFk60hH+lgCLsdI1sQ==
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 50219
Cc: Lars Ingebrigtsen <larsi@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>, 50219 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eric Abrahamsen <eric@HIDDEN> writes:

> > This sounds like Bug#39169.  Did I forget to commit the fix I had
> > posted there?
>
> I thought I'd seen discussion about this before! The code you described
> in that bug report did get committed, so I can only assume this is a
> separate but look-alike situation.

Please search for the string "use \\='%s" in eieio-core.el.  We made one
of three occurrences less confusing, seems you hit some other (2/3?).  I
guess we want to change this one as well.

AFAIR you can also just disable `eieio-backward-compatibility' (file or
directory locally).

Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50219; Package emacs. Full text available.

Message received at 50219 <at> debbugs.gnu.org:


Received: (at 50219) by debbugs.gnu.org; 29 Aug 2021 15:42:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Aug 29 11:42:08 2021
Received: from localhost ([127.0.0.1]:57232 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mKMwe-0007uX-Gf
	for submit <at> debbugs.gnu.org; Sun, 29 Aug 2021 11:42:08 -0400
Received: from mail.ericabrahamsen.net ([52.70.2.18]:54698)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eric@HIDDEN>) id 1mKMwZ-0007tz-0u
 for 50219 <at> debbugs.gnu.org; Sun, 29 Aug 2021 11:42:03 -0400
Received: from localhost (c-73-109-4-106.hsd1.wa.comcast.net [73.109.4.106])
 (Authenticated sender: eric@HIDDEN)
 by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 5FC3CFA82D;
 Sun, 29 Aug 2021 15:41:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net;
 s=mail; t=1630251712;
 bh=2C7YczYXSvOr6b546uQNW6uFYabTuXkO9M4NJsTKYts=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=m8M70Qh3uKt76N2ZSdqrPVaXNeYXBwhbSAnp7fycb5LaMyFub9XsAUJ0fSIo9cBo/
 uWwmPyCe/gB3UrLt8eEXpBHOzGv55vGqJoTZl+0YZB6zpXwBvYuJ3DWTxsISb4y/s+
 V8wZHm0+9d46vq++y7T9XZsBk0HnmqeoR9sVUU7Q=
From: Eric Abrahamsen <eric@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
Subject: Re: bug#50219: 28.0.50; Provide better errors when trying to
 specialize on optional args in generic methods
References: <87k0k7by2w.fsf@HIDDEN> <87bl5ju3me.fsf@HIDDEN>
 <87pmtzpta7.fsf@HIDDEN>
 <jwvczpxll10.fsf-monnier+emacs@HIDDEN> <871r6dimlb.fsf@HIDDEN>
 <jwvmtp1jzh0.fsf-monnier+emacs@HIDDEN> <87wno5h4sy.fsf@HIDDEN>
 <jwvy28lii82.fsf-monnier+emacs@HIDDEN>
 <87fsutkrfz.fsf@HIDDEN> <874kb8sdz6.fsf@HIDDEN>
Date: Sun, 29 Aug 2021 08:41:51 -0700
In-Reply-To: <874kb8sdz6.fsf@HIDDEN> (Michael Heerdegen's message of "Sun, 29
 Aug 2021 13:10:53 +0200")
Message-ID: <874kb8l0lc.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50219
Cc: Lars Ingebrigtsen <larsi@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>, 50219 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)


On 08/29/21 13:10 PM, Michael Heerdegen wrote:
> Eric Abrahamsen <eric@HIDDEN> writes:
>
>> "`ebdb-record' is an obsolete variable, use `ebdb-record' instead"
>
> This sounds like Bug#39169.  Did I forget to commit the fix I had
> posted there?

I thought I'd seen discussion about this before! The code you described
in that bug report did get committed, so I can only assume this is a
separate but look-alike situation.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50219; Package emacs. Full text available.

Message received at 50219 <at> debbugs.gnu.org:


Received: (at 50219) by debbugs.gnu.org; 29 Aug 2021 11:11:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Aug 29 07:11:16 2021
Received: from localhost ([127.0.0.1]:55675 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mKIia-0000vy-0j
	for submit <at> debbugs.gnu.org; Sun, 29 Aug 2021 07:11:16 -0400
Received: from mout.web.de ([212.227.17.11]:40463)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael_heerdegen@HIDDEN>) id 1mKIiW-0000vj-Oa
 for 50219 <at> debbugs.gnu.org; Sun, 29 Aug 2021 07:11:14 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de;
 s=dbaedf251592; t=1630235454;
 bh=FZjvsnNjwuJOeU920Ncayc6Nblh6pgz8P+s4W4kgXDU=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To;
 b=VBNcmoKWi1oD/h1G5dwGJ9qzLLk5jAxHrLWuAbTpb8Oqiv8/fErHZBT9/DWgJeXL6
 CpK+2SuZRj/gjz53f6VIMK9cjxGxAE0CSVqhi2V7lTTwDYrHqS2G7QJ0cW/u3P0ZvZ
 MMllbwdDTpSIb4OEusDjCJbsFD+QQCa3Yyy/lrK0=
X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9
Received: from drachen.dragon ([88.66.201.155]) by smtp.web.de (mrweb105
 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MsrdC-1n8xUM1mjg-00t9xI; Sun, 29
 Aug 2021 13:10:54 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Eric Abrahamsen <eric@HIDDEN>
Subject: Re: bug#50219: 28.0.50; Provide better errors when trying to
 specialize on optional args in generic methods
References: <87k0k7by2w.fsf@HIDDEN> <87bl5ju3me.fsf@HIDDEN>
 <87pmtzpta7.fsf@HIDDEN>
 <jwvczpxll10.fsf-monnier+emacs@HIDDEN> <871r6dimlb.fsf@HIDDEN>
 <jwvmtp1jzh0.fsf-monnier+emacs@HIDDEN> <87wno5h4sy.fsf@HIDDEN>
 <jwvy28lii82.fsf-monnier+emacs@HIDDEN>
 <87fsutkrfz.fsf@HIDDEN>
Date: Sun, 29 Aug 2021 13:10:53 +0200
In-Reply-To: <87fsutkrfz.fsf@HIDDEN> (Eric Abrahamsen's message of
 "Sat, 28 Aug 2021 17:47:12 -0700")
Message-ID: <874kb8sdz6.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:aLxfVP0OFhvQOoGoOdapFu0hCl6TxkCMMJgZJIiAT30mHNqYHZw
 p3vXEuhEbXtvQZckeqYIJGrUMYGI5JJD3UEfxaZNwT82dr4MuLHnPyd8pg+yFECygsAY0Si
 bAuKwc4k8hr05oJFhG1Wdck63cGUnTKcr9Nfn0SmbJWl2QmNuG4tT3LRpZKLCma8YEZ2bLX
 mCfKTBWWMntWrySiLf9Rg==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:JZuw+iIpJgQ=:NHkfbP4yBU1mEPMvY4StpL
 3jfWpZ1xzkNc5+hXwWFr0GBBfMyztpRWRfLj1hV+ZYmurvLsVtN+HMUsA8ECYnc720s+gnwws
 /zxrAv0Z3Q0glpnigVOqOyxBgzKXly3WfsbKxQTo3bEjw9QVe0fSMiZW+2VePfHJ9ktoZ64gb
 yRN15iahVGrcarxziu+e6ueCQ1vI44R2HJxpOD9AIcZmM7GoG9g9JaUa5zJir+lcYSUXPAebj
 UYJ7PUT3lXeOlbK1hwOO3pr4VqjQ4qAfSpphAukhKxF9p3ezPApui+FB2YT0FUBRQ6XYo6Uo7
 fvD0P05eK+iM6+axgCwgkW3zRxEGSL5kKN3D8zSe0wJBf9bJbnjGVVe5KZ4yaLHVJmq5m/wQz
 5DrxMFTvit1J7Z0ODi1IJJBPtTTIz1VtFq2p16btsDolY09E2bOGP9d3kzGnZl9zrHNQiQdCT
 b1w9z91e4TPZebsi5VR8V5ellUPsTHiEE8K7boi1jQrvY9DNrz+nrqVyWSd5BkRL9qasWNGpG
 ls5dDj92P+a5aMwM30q0ejvLN5pq44ENIsNHH7eLLPFoTXUB9yOe1uWHATX8V+L3oZxmvdSUi
 pzrruCFd9H/CgLJa1fQeT6ot61Mk1bmgvfXMgr4D1gwnDmbGqyxyiBZU73U9Ev8MuUGeX+Hqd
 zmprDDPwmW5bmMXcE1eYZPZQ+SgzLeCm7gRgy7QdN3baSviMYmImjEQXJrA3QbUMzAtIv2IBe
 EKb6sNBncTbM9cgXiQRDWdCWojlz9Qce16JkFz0X6y76piJ5nkWbQ2bGOMzb8Af5UQWw0Gx7R
 sZ8DzIGt7IuAlEVSCBwfLoJ/rXwt54EHFE57RBK9Xu0D/G0GGg89mLCl9vuWnlABcru1iy4Ws
 aRsMwV1ictmO0+JmPW3sRynQtrEQQqm199HDHl5wzaJwfuI/gd2h2FjKNalhZ5twFtdO/shfs
 4v3ovNtOA2kZuMZhUehRo86QGA+ZbDUNzB0uXr8L3jhAZA7TELWWh3tX6i6ZQAUGM73zD0t3z
 n7ungm4wIQNZjOJmcnmlyE6G1mwFSN+W2AOSADMLyQB/cxlG/QJts1YFO4fZH/x9IPS1iwEjw
 ZmHbclToLAH0araihD+qf1v0B/hSNZ76YIqVEeUH2Sf+vfPJ+LNy43dqg==
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 50219
Cc: Lars Ingebrigtsen <larsi@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>, 50219 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eric Abrahamsen <eric@HIDDEN> writes:

> "`ebdb-record' is an obsolete variable, use `ebdb-record' instead"

This sounds like Bug#39169.  Did I forget to commit the fix I had
posted there?

Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50219; Package emacs. Full text available.

Message received at 50219 <at> debbugs.gnu.org:


Received: (at 50219) by debbugs.gnu.org; 29 Aug 2021 00:47:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 28 20:47:27 2021
Received: from localhost ([127.0.0.1]:55175 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mK8yt-0006E2-BY
	for submit <at> debbugs.gnu.org; Sat, 28 Aug 2021 20:47:27 -0400
Received: from mail.ericabrahamsen.net ([52.70.2.18]:36794)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eric@HIDDEN>) id 1mK8yq-0006Dl-1h
 for 50219 <at> debbugs.gnu.org; Sat, 28 Aug 2021 20:47:26 -0400
Received: from localhost (c-73-109-4-106.hsd1.wa.comcast.net [73.109.4.106])
 (Authenticated sender: eric@HIDDEN)
 by mail.ericabrahamsen.net (Postfix) with ESMTPSA id DD955FA82D;
 Sun, 29 Aug 2021 00:47:17 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net;
 s=mail; t=1630198038;
 bh=tzwnqlD5tOaQkaUikIiU5NbB5pqLTgWRcEUVnvnMeqU=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=JVTnf6mTvJtE7VzdUYASLMnQJw4v/m2X8Q+VVsQbv9wa4xdbux3FTNgXmenAGh7kr
 t5qI6xXbAlLATI3N6e0MmzMmnOHTbP/HaZRNdhP3qFNnWJfnvCfj/5HY9PD82aqqpy
 mJRx7MUSv2TjKb+OYN+4FM5Lbuf2WhP+oxDd0V6A=
From: Eric Abrahamsen <eric@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#50219: 28.0.50; Provide better errors when trying to
 specialize on optional args in generic methods
References: <87k0k7by2w.fsf@HIDDEN> <87bl5ju3me.fsf@HIDDEN>
 <87pmtzpta7.fsf@HIDDEN>
 <jwvczpxll10.fsf-monnier+emacs@HIDDEN> <871r6dimlb.fsf@HIDDEN>
 <jwvmtp1jzh0.fsf-monnier+emacs@HIDDEN> <87wno5h4sy.fsf@HIDDEN>
 <jwvy28lii82.fsf-monnier+emacs@HIDDEN>
Date: Sat, 28 Aug 2021 17:47:12 -0700
In-Reply-To: <jwvy28lii82.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Sat, 28 Aug 2021 13:41:48 -0400")
Message-ID: <87fsutkrfz.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50219
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, 50219 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)


On 08/28/21 13:41 PM, Stefan Monnier wrote:
>> (cl-defmethod foo ((a integer) &optional (b string))
>>   ...)
>>
>> on the other hand, looks like the person who wrote it wanted to
>> specialise on b, so if the default is something that is a type
>> specifier, then we could output an additional warning about that.
>
> The default value part of args in Common lisp arglists is an
> *expression*, so (b string) just means that `b` should take the value of
> the `string` variable.
>
> The best I can see (if we keep the CL arglist feature) is to try and see
> if that expression looks like a valid CLOS specializer and if so emit
> a warning about possible confusion.

That's a pretty byzantine set of rules! Anyway, I think "reference to
free variable string" is probably close enough to clue the developer in
to what is happening. In the case of an EIEIO class name, though, the
error was:

"`ebdb-record' is an obsolete variable, use `ebdb-record' instead"

which is just...

So maybe something special for class and struct types would be sufficient?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50219; Package emacs. Full text available.

Message received at 50219 <at> debbugs.gnu.org:


Received: (at 50219) by debbugs.gnu.org; 28 Aug 2021 17:49:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 28 13:49:29 2021
Received: from localhost ([127.0.0.1]:54965 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mK2SO-0003rp-U5
	for submit <at> debbugs.gnu.org; Sat, 28 Aug 2021 13:49:29 -0400
Received: from quimby.gnus.org ([95.216.78.240]:45044)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mK2SL-0003ra-B9
 for 50219 <at> debbugs.gnu.org; Sat, 28 Aug 2021 13:49:27 -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:In-Reply-To:Date:
 References: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=iIQplDop9Jv7NN2U6uTHmMdmpQNsreVk7TQwEJRI8RI=; b=q64IVxOIz5MRphHBKqtFqsRQ/u
 0J+bx+G5CIgPckVxl4htSHMgwROXtxgyOKBCR+jCT8hbCrzlLuaYEaOSWVS7eMWeji1nTKUWrFW7o
 2scVcZcE/MVZz+ZxtKbQRu1DZQs4JqFqoIJ2tg7auFeNtzhSG36pv0FS38FCmRD3UtBY=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mK2S9-0006Ho-PS; Sat, 28 Aug 2021 19:49:18 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#50219: 28.0.50; Provide better errors when trying to
 specialize on optional args in generic methods
References: <87k0k7by2w.fsf@HIDDEN> <87bl5ju3me.fsf@HIDDEN>
 <87pmtzpta7.fsf@HIDDEN>
 <jwvczpxll10.fsf-monnier+emacs@HIDDEN> <871r6dimlb.fsf@HIDDEN>
 <jwvmtp1jzh0.fsf-monnier+emacs@HIDDEN> <87wno5h4sy.fsf@HIDDEN>
 <jwvy28lii82.fsf-monnier+emacs@HIDDEN>
Date: Sat, 28 Aug 2021 19:49:11 +0200
In-Reply-To: <jwvy28lii82.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Sat, 28 Aug 2021 13:41:48 -0400")
Message-ID: <87sfyth33c.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
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 <monnier@HIDDEN> writes: > The
 default
 value part of args in Common lisp arglists is an > *expression*, so (b string)
 just means that `b` should take the value of > the `string` variable. > >
 The best I can see (if we keep th [...] 
 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: 50219
Cc: Eric Abrahamsen <eric@HIDDEN>, 50219 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Stefan Monnier <monnier@HIDDEN> writes:

> The default value part of args in Common lisp arglists is an
> *expression*, so (b string) just means that `b` should take the value of
> the `string` variable.
>
> The best I can see (if we keep the CL arglist feature) is to try and see
> if that expression looks like a valid CLOS specializer and if so emit
> a warning about possible confusion.

Yes, that's what I tried to say.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50219; Package emacs. Full text available.

Message received at 50219 <at> debbugs.gnu.org:


Received: (at 50219) by debbugs.gnu.org; 28 Aug 2021 17:42:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 28 13:42:06 2021
Received: from localhost ([127.0.0.1]:54961 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mK2LC-0003gD-Gp
	for submit <at> debbugs.gnu.org; Sat, 28 Aug 2021 13:42:06 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:46774)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1mK2L7-0003fh-FK
 for 50219 <at> debbugs.gnu.org; Sat, 28 Aug 2021 13:42:01 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 1E2B8100221;
 Sat, 28 Aug 2021 13:41:51 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id C0090100091;
 Sat, 28 Aug 2021 13:41:49 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1630172509;
 bh=FvvDJjgvoJTIf0tSxCES8rsOBVfica5BvOD29wYnrLs=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=iYHCLXQbjHykbmQz+KgN14thOsvoWEk3AJGS3sL83CD/nNAHqEwKxizaqATxbbgiH
 I43OrWMtXLXFQTe5KiwagxPpF+vLkhJlGZrtS4wDd9M9tdy+JWWhnffDkrv20FKkCp
 WOkRe1yHC7VtTTrHb9qwlBeKVF5c8h6OhZ9yiYTcqFCswhOkXsPR+esI396UIkTz46
 FQtUn+Zn5Sk8LkPtXKlVXCcBa0H8Kcv992Wa0Pxj/NFkcVDY52JmR9pRvQVesqz2E8
 g5XtmQwBU846j5wpNFVobwZKcrbURCeLLYCnlvFMo9+y8rOwM+KI5mZukzruXcbbVS
 GaGhv0aH+32eA==
Received: from alfajor (unknown [104.247.244.135])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8898B120377;
 Sat, 28 Aug 2021 13:41:49 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#50219: 28.0.50; Provide better errors when trying to
 specialize on optional args in generic methods
Message-ID: <jwvy28lii82.fsf-monnier+emacs@HIDDEN>
References: <87k0k7by2w.fsf@HIDDEN> <87bl5ju3me.fsf@HIDDEN>
 <87pmtzpta7.fsf@HIDDEN>
 <jwvczpxll10.fsf-monnier+emacs@HIDDEN> <871r6dimlb.fsf@HIDDEN>
 <jwvmtp1jzh0.fsf-monnier+emacs@HIDDEN> <87wno5h4sy.fsf@HIDDEN>
Date: Sat, 28 Aug 2021 13:41:48 -0400
In-Reply-To: <87wno5h4sy.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Sat,
 28 Aug 2021 19:12:13 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.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.058 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: 50219
Cc: Eric Abrahamsen <eric@HIDDEN>, 50219 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> (cl-defmethod foo ((a integer) &optional (b string))
>   ...)
>
> on the other hand, looks like the person who wrote it wanted to
> specialise on b, so if the default is something that is a type
> specifier, then we could output an additional warning about that.

The default value part of args in Common lisp arglists is an
*expression*, so (b string) just means that `b` should take the value of
the `string` variable.

The best I can see (if we keep the CL arglist feature) is to try and see
if that expression looks like a valid CLOS specializer and if so emit
a warning about possible confusion.

I wonder what Common Lisp compilers do.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50219; Package emacs. Full text available.

Message received at 50219 <at> debbugs.gnu.org:


Received: (at 50219) by debbugs.gnu.org; 28 Aug 2021 17:12:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 28 13:12:36 2021
Received: from localhost ([127.0.0.1]:54944 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mK1sd-0002v2-Uf
	for submit <at> debbugs.gnu.org; Sat, 28 Aug 2021 13:12:36 -0400
Received: from quimby.gnus.org ([95.216.78.240]:44776)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mK1sX-0002ui-RF
 for 50219 <at> debbugs.gnu.org; Sat, 28 Aug 2021 13:12:30 -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:In-Reply-To:Date:
 References: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=wDAn6lMrLf33/DogWm44F6rREzctwVhio8CUkWDqeJ0=; b=V0fY3aGjHi+foiwTWtQTph3uW2
 rQdsYDFezADSmyx2oHnFfO3m8NQJUA7t41zxO+bOMoJrRaCF9QmHG061Fj5kvy4WIkQXDzBnOXZsC
 oBpdj3mcOvNzYKXYbK6BZ9/r4M7oJGTTuuT5TyRf1aqxBdc29siDnrNl0UFu9ZzDCJrQ=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mK1sL-0005vz-VU; Sat, 28 Aug 2021 19:12:18 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#50219: 28.0.50; Provide better errors when trying to
 specialize on optional args in generic methods
References: <87k0k7by2w.fsf@HIDDEN> <87bl5ju3me.fsf@HIDDEN>
 <87pmtzpta7.fsf@HIDDEN>
 <jwvczpxll10.fsf-monnier+emacs@HIDDEN> <871r6dimlb.fsf@HIDDEN>
 <jwvmtp1jzh0.fsf-monnier+emacs@HIDDEN>
Date: Sat, 28 Aug 2021 19:12:13 +0200
In-Reply-To: <jwvmtp1jzh0.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Sat, 28 Aug 2021 12:42:33 -0400")
Message-ID: <87wno5h4sy.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
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 <monnier@HIDDEN> writes: >> Hm...
 So the warning here is correct, I guess. But perhaps it could >> also have
 said something about it being ambiguous syntax (since is also >> knows the
 declared parameter list from `cl-defgener [...] 
 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: 50219
Cc: Eric Abrahamsen <eric@HIDDEN>, 50219 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Stefan Monnier <monnier@HIDDEN> writes:

>> Hm...  So the warning here is correct, I guess.  But perhaps it could
>> also have said something about it being ambiguous syntax (since is also
>> knows the declared parameter list from `cl-defgeneric')...
>
> [ I don't see how the arglist of `cl-defgeneric` would have helped here
>   discover the confusion.  ]

I may be misremembering the semantics of defgeneric, but I thought it
was fine to say:

(cl-defgeneric zot (a &optional b)
  )

But this means that you can only specialise on a -- b is an optional
argument.  So

(cl-defmethod zot ((a integer) &optional (b "foo"))
  (list a b))

is fine and valid -- it's a default value for b.

(cl-defmethod foo ((a integer) &optional (b string))
  ...)

on the other hand, looks like the person who wrote it wanted to
specialise on b, so if the default is something that is a type
specifier, then we could output an additional warning about that.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50219; Package emacs. Full text available.

Message received at 50219 <at> debbugs.gnu.org:


Received: (at 50219) by debbugs.gnu.org; 28 Aug 2021 16:42:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 28 12:42:51 2021
Received: from localhost ([127.0.0.1]:54929 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mK1Pr-00023A-61
	for submit <at> debbugs.gnu.org; Sat, 28 Aug 2021 12:42:50 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:44178)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1mK1Pl-00022m-SX
 for 50219 <at> debbugs.gnu.org; Sat, 28 Aug 2021 12:42:45 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id A2FD010025D;
 Sat, 28 Aug 2021 12:42:35 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 1CEE71001F4;
 Sat, 28 Aug 2021 12:42:34 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1630168954;
 bh=v+GjfLFfrlcS/fee0t5s0jF9aaCeLjL3IHzEt7mQ7HA=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=eu78j5MShkjPmYLEYjuQl8Yfj1C9Emnf5tU3mppS2MYXaJGKE9MHw8Vk2CFwmmKvg
 xgykNTAhcSTU6MmTtq/4yTJNvTevm5JDohOwyMO5x00O027QiHvwzHRhCS4eF/oPOr
 Tu/DWG6jrI6l8q2D22BoQI3HlwhlR7XYgVgRYHE90j9v0s8G0FxIK+5NCe7YloHSUj
 vHNhhODhDZCXsj0jytB5oKJGoqIm2qVTgHtr6wa/f1wNmOPvCUOua+VOqp0pHxFCCy
 hZF4Iz9j3w0ikgzxz/vUY9KSSx8fGEqzliw7M3gnK9Waz0up1VcOSm/etHNgKqjyoK
 IUSRQK8Z9mQ+g==
Received: from alfajor (unknown [104.247.244.135])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D7A5012033E;
 Sat, 28 Aug 2021 12:42:33 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#50219: 28.0.50; Provide better errors when trying to
 specialize on optional args in generic methods
Message-ID: <jwvmtp1jzh0.fsf-monnier+emacs@HIDDEN>
References: <87k0k7by2w.fsf@HIDDEN> <87bl5ju3me.fsf@HIDDEN>
 <87pmtzpta7.fsf@HIDDEN>
 <jwvczpxll10.fsf-monnier+emacs@HIDDEN> <871r6dimlb.fsf@HIDDEN>
Date: Sat, 28 Aug 2021 12:42:33 -0400
In-Reply-To: <871r6dimlb.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Sat,
 28 Aug 2021 18:02:40 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.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.058 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: 50219
Cc: Eric Abrahamsen <eric@HIDDEN>, 50219 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Hm...  So the warning here is correct, I guess.  But perhaps it could
> also have said something about it being ambiguous syntax (since is also
> knows the declared parameter list from `cl-defgeneric')...

[ I don't see how the arglist of `cl-defgeneric` would have helped here
  discover the confusion.  ]

Or we could deprecate the use of Common-Lisp style arglists in
cl-defmethod.  I don't know how often it's used, tho.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50219; Package emacs. Full text available.

Message received at 50219 <at> debbugs.gnu.org:


Received: (at 50219) by debbugs.gnu.org; 28 Aug 2021 16:03:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 28 12:03:03 2021
Received: from localhost ([127.0.0.1]:54878 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mK0nK-0000pt-J6
	for submit <at> debbugs.gnu.org; Sat, 28 Aug 2021 12:03:02 -0400
Received: from quimby.gnus.org ([95.216.78.240]:44250)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mK0nE-0000pa-1j
 for 50219 <at> debbugs.gnu.org; Sat, 28 Aug 2021 12:02:56 -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:In-Reply-To:Date:
 References: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=VTN3BgGnYMU+VvaAMp9fZweutLWKCA3y8Nrc9bD/sxs=; b=eVmV1/yaOdNnuBzV5OzHj6ENp4
 ag0CfJzYc7s6Ne/wJgQSr6/Q82Sd7mmpPrX9j1AsbJ1oMS9vLp4vdItPa8oJgtgOzdlKgZUQ2OhUd
 RJ73xRHJMNsbfF8HQMI6iqQgS8kuExdLnFmC9uYezgVQNyKwXnBCQYe5qLnquZLdzdsA=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mK0n2-0005IP-GT; Sat, 28 Aug 2021 18:02:44 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#50219: 28.0.50; Provide better errors when trying to
 specialize on optional args in generic methods
References: <87k0k7by2w.fsf@HIDDEN> <87bl5ju3me.fsf@HIDDEN>
 <87pmtzpta7.fsf@HIDDEN>
 <jwvczpxll10.fsf-monnier+emacs@HIDDEN>
Date: Sat, 28 Aug 2021 18:02:40 +0200
In-Reply-To: <jwvczpxll10.fsf-monnier+emacs@HIDDEN> (Stefan Monnier's message
 of "Sat, 28 Aug 2021 10:15:17 -0400")
Message-ID: <871r6dimlb.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
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 <monnier@HIDDEN> writes: > Eric
 Abrahamsen
 [2021-08-26 18:31:44] wrote: >> (cl-defmethod testy ((arg1 string) &optional
 (arg2 integer)) >> (message "Don't do this")) > [...] >> Warning: reference
 to free variable 'integer' > [...] 
 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: 50219
Cc: Eric Abrahamsen <eric@HIDDEN>, 50219 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Stefan Monnier <monnier@HIDDEN> writes:

> Eric Abrahamsen [2021-08-26 18:31:44] wrote:
>> (cl-defmethod testy ((arg1 string) &optional (arg2 integer))
>>   (message "Don't do this"))
> [...]
>> Warning: reference to free variable 'integer'
>
> Hmm....
>
> The same thing happens in Common-Lisp, tho.  What's going on here is
> that the arglist of `cl-defmethod` allows Common-Lisp style arguments
> (e.g. `&key`) so your `(arg2 integer)` means to use `integer` as the
> default value for `arg2`, just as in
>
>     (cl-defun testy (arg1 &optional (arg2 integer)) ...)

Hm...  So the warning here is correct, I guess.  But perhaps it could
also have said something about it being ambiguous syntax (since is also
knows the declared parameter list from `cl-defgeneric')...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50219; Package emacs. Full text available.

Message received at 50219 <at> debbugs.gnu.org:


Received: (at 50219) by debbugs.gnu.org; 28 Aug 2021 14:15:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 28 10:15:40 2021
Received: from localhost ([127.0.0.1]:54781 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mJz7U-00026M-0c
	for submit <at> debbugs.gnu.org; Sat, 28 Aug 2021 10:15:40 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:19199)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1mJz7Q-000262-3v
 for 50219 <at> debbugs.gnu.org; Sat, 28 Aug 2021 10:15:39 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 3587A803CA;
 Sat, 28 Aug 2021 10:15:30 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B1B9A8075E;
 Sat, 28 Aug 2021 10:15:24 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1630160124;
 bh=arEbV9/9T2eblNbyEZeE8/WbIUckSM2msJpgGaGa0eI=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=BIROylc8Gqd85Y3y2AWCSyViza0WaDkk8evXyzxH8ncVzFM8euIiwKuNFAt9c6JQb
 aYijMWrw677qacswToDnLJ6YzPwn3DbQsRCyCpJ6z/2SXTp3uQZzU79Jrmu+46DJby
 2Yw049FtBzzTjLqSUSXe/mOOo1K3PHdjEkVt05n5j4pejMk9iWyULULq8XvLYlS/zt
 QiF/TgTBlWgRAu0+SaCtJcSgrTDxN18EgJsZ+WMAfjUmqXjRatoBoFtT5VSAYO8aEJ
 WMoYk5IhvYhBdEmKTfZdD+EFCGE3jIvDD23icalvEJpo7TbSwuGSaiNMK44dd1NWNF
 svbvkLT+2QCbw==
Received: from alfajor (unknown [104.247.244.135])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 776D6120180;
 Sat, 28 Aug 2021 10:15:24 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Eric Abrahamsen <eric@HIDDEN>
Subject: Re: bug#50219: 28.0.50; Provide better errors when trying to
 specialize on optional args in generic methods
Message-ID: <jwvczpxll10.fsf-monnier+emacs@HIDDEN>
References: <87k0k7by2w.fsf@HIDDEN> <87bl5ju3me.fsf@HIDDEN>
 <87pmtzpta7.fsf@HIDDEN>
Date: Sat, 28 Aug 2021 10:15:17 -0400
In-Reply-To: <87pmtzpta7.fsf@HIDDEN> (Eric Abrahamsen's message of
 "Thu, 26 Aug 2021 18:31:44 -0700")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.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.057 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: 50219
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, 50219 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Eric Abrahamsen [2021-08-26 18:31:44] wrote:
> (cl-defmethod testy ((arg1 string) &optional (arg2 integer))
>   (message "Don't do this"))
[...]
> Warning: reference to free variable 'integer'

Hmm....

The same thing happens in Common-Lisp, tho.  What's going on here is
that the arglist of `cl-defmethod` allows Common-Lisp style arguments
(e.g. `&key`) so your `(arg2 integer)` means to use `integer` as the
default value for `arg2`, just as in

    (cl-defun testy (arg1 &optional (arg2 integer)) ...)


-- Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50219; Package emacs. Full text available.

Message received at 50219 <at> debbugs.gnu.org:


Received: (at 50219) by debbugs.gnu.org; 27 Aug 2021 01:31:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 26 21:31:55 2021
Received: from localhost ([127.0.0.1]:50824 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mJQio-0000ic-W5
	for submit <at> debbugs.gnu.org; Thu, 26 Aug 2021 21:31:55 -0400
Received: from mail.ericabrahamsen.net ([52.70.2.18]:57896)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eric@HIDDEN>) id 1mJQim-0000iN-Up
 for 50219 <at> debbugs.gnu.org; Thu, 26 Aug 2021 21:31:54 -0400
Received: from localhost (c-73-109-4-106.hsd1.wa.comcast.net [73.109.4.106])
 (Authenticated sender: eric@HIDDEN)
 by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 16B89FA827;
 Fri, 27 Aug 2021 01:31:45 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net;
 s=mail; t=1630027906;
 bh=/hW3FotvW0rvglEMNI1dBcXRdD4dAOIZuEMfuWf3Sec=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From;
 b=t95nwLDl7UeGo79+5UuGl9X/NGhddXKWck4WdoOMPOvKoc4u0fvQ9yZQuF3umE/Ii
 zx7EeJmEM8+/cSqAxqV1L0/BatscbIowj3EiN8H2NkjZ5vhpAmW+oSI8prxxcG8xeT
 hBUMI8jsCDzpkYt9Mm7k1nwXf3NhAqXQQwih9ct8=
From: Eric Abrahamsen <eric@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#50219: 28.0.50; Provide better errors when trying to
 specialize on optional args in generic methods
References: <87k0k7by2w.fsf@HIDDEN> <87bl5ju3me.fsf@HIDDEN>
Date: Thu, 26 Aug 2021 18:31:44 -0700
In-Reply-To: <87bl5ju3me.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Fri,
 27 Aug 2021 02:34:49 +0200")
Message-ID: <87pmtzpta7.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 50219
Cc: 50219 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

--=-=-=
Content-Type: text/plain

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Eric Abrahamsen <eric@HIDDEN> writes:
>
>> - the manual section on "Generic Functions" could say explicitly that
>>   you can't specialize on optional arguments
>> - `eval'ling the `defmethod' form above could raise an error directly
>> - the compiler could say more explicitly what the problem is
>>
>> I'd favor all three of these changes!
>
> Me, too.

Here's a very simply manual patch.

I squinted long and hard at cl-generic.el, and I'm not confident about where
we'd put the error. In `cl--generic-lambda'?

>> Happy to implement what I can (maybe not the compiler part).
>
> I've added Stefan to the CCs; perhaps he has some comments.

He has already (kindly) made fun of me for my dumb code, so he ought to
be aware. :)


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=dont-specialize-optional-args.diff

diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index 77d1465c87..6d4a93b08a 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -1208,6 +1208,8 @@ Generic Functions
 Extensions for GNU Emacs Lisp}), or of one of its child classes.
 @end table
 
+Arguments marked as &optional can't be specialized on.
+
 Method definitions can make use of a new argument-list keyword,
 @code{&context}, which introduces extra specializers that test the
 environment at the time the method is run.  This keyword should appear

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50219; Package emacs. Full text available.

Message received at 50219 <at> debbugs.gnu.org:


Received: (at 50219) by debbugs.gnu.org; 27 Aug 2021 00:35:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 26 20:35:11 2021
Received: from localhost ([127.0.0.1]:50790 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mJPpv-0005iB-1h
	for submit <at> debbugs.gnu.org; Thu, 26 Aug 2021 20:35:11 -0400
Received: from quimby.gnus.org ([95.216.78.240]:53080)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mJPps-0005hs-TZ
 for 50219 <at> debbugs.gnu.org; Thu, 26 Aug 2021 20:35:09 -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:In-Reply-To:Date:
 References: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=jis6DTJUupv/5jiZUzRXEQg4DzhQsrbF4a59WzuuaeY=; b=VV1QpQg6h51h1x8BkqPySRqP+F
 qljBRS3l9ep/iejlLqgA/xpY3/NUbBcgDavX+KH0yQdF157MbT7l9cVzht6FBM/7ldOHUnbWGJ/C7
 YHEZkEjyisMtzpgbQc6SFOxxq3gd1XHwE6dMwS6yyVSPJholXtKEAAOutVTGE8qAYcWs=;
Received: from [84.212.220.105] (helo=elva)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mJPpb-00082a-PG; Fri, 27 Aug 2021 02:34:56 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Eric Abrahamsen <eric@HIDDEN>
Subject: Re: bug#50219: 28.0.50; Provide better errors when trying to
 specialize on optional args in generic methods
References: <87k0k7by2w.fsf@HIDDEN>
Date: Fri, 27 Aug 2021 02:34:49 +0200
In-Reply-To: <87k0k7by2w.fsf@HIDDEN> (Eric Abrahamsen's message of
 "Thu, 26 Aug 2021 16:11:51 -0700")
Message-ID: <87bl5ju3me.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
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:  Eric Abrahamsen <eric@HIDDEN> writes: > - the
 manual section on "Generic Functions" could say explicitly that > you can't
 specialize on optional arguments > - `eval'ling the `defmethod' form above
 could raise an error directly > - the com [...] 
 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: 50219
Cc: 50219 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Eric Abrahamsen <eric@HIDDEN> writes:

> - the manual section on "Generic Functions" could say explicitly that
>   you can't specialize on optional arguments
> - `eval'ling the `defmethod' form above could raise an error directly
> - the compiler could say more explicitly what the problem is
>
> I'd favor all three of these changes!

Me, too.

> Happy to implement what I can (maybe not the compiler part).

I've added Stefan to the CCs; perhaps he has some comments.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#50219; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 26 Aug 2021 23:11:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 26 19:11:59 2021
Received: from localhost ([127.0.0.1]:50752 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mJOXP-0003jj-3j
	for submit <at> debbugs.gnu.org; Thu, 26 Aug 2021 19:11:59 -0400
Received: from lists.gnu.org ([209.51.188.17]:52902)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eric@HIDDEN>) id 1mJOXN-0003jc-Iv
 for submit <at> debbugs.gnu.org; Thu, 26 Aug 2021 19:11:58 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:41296)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eric@HIDDEN>)
 id 1mJOXM-0005uy-FW
 for bug-gnu-emacs@HIDDEN; Thu, 26 Aug 2021 19:11:57 -0400
Received: from mail.ericabrahamsen.net ([52.70.2.18]:59268)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eric@HIDDEN>)
 id 1mJOXK-00013Y-3C
 for bug-gnu-emacs@HIDDEN; Thu, 26 Aug 2021 19:11:56 -0400
Received: from localhost (75-172-126-110.tukw.qwest.net [75.172.126.110])
 (Authenticated sender: eric@HIDDEN)
 by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 362F8FA827
 for <bug-gnu-emacs@HIDDEN>; Thu, 26 Aug 2021 23:11:52 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net;
 s=mail; t=1630019512;
 bh=5gSFLbiQPtjEAoHJXHb2RsBcp2MjtPh65jFiqqDAwGs=;
 h=From:To:Subject:Date:From;
 b=LQZ2y75Z5V7D8N0ub5sRNQENumpa4TqZNW7W8ylN6S07Plru5V8GOn0/xWiQlAWl8
 2GwQcA63AA3KeI8L9GqjWL1GKUota9yCgMcRfx/n6iUiVWjIYZV8hCWk/hilHLuCpk
 B4wx/T9kZYCW4NU47R8t0b2jWo+LxWpgFqvRMlcY=
From: Eric Abrahamsen <eric@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 28.0.50; Provide better errors when trying to specialize on
 optional args in generic methods
Date: Thu, 26 Aug 2021 16:11:51 -0700
Message-ID: <87k0k7by2w.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=52.70.2.18; envelope-from=eric@HIDDEN;
 helo=mail.ericabrahamsen.net
X-Spam_score_int: -43
X-Spam_score: -4.4
X-Spam_bar: ----
X-Spam_report: (-4.4 / 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_MED=-2.3, 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 <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)


If you write a generic method and try to specialize on an &optional
argument, like so:

--8<---------------cut here---------------start------------->8---
(cl-defgeneric testy (arg1 &optional arg2))

(cl-defmethod testy ((arg1 string) &optional (arg2 integer))
  (message "Don't do this"))
--8<---------------cut here---------------end--------------->8---

It will behave weirdly when you try to call the function with a second
argument, but won't bark at you when you evaluate this form, and during
compilation will give you the error:

Warning: reference to free variable 'integer'

I was doing this with a specialization on an EIEIO class in EBDB, and
the warning was even weirder, but never mind that.

A few things could be done here:

- the manual section on "Generic Functions" could say explicitly that
  you can't specialize on optional arguments
- `eval'ling the `defmethod' form above could raise an error directly
- the compiler could say more explicitly what the problem is

I'd favor all three of these changes! Happy to implement what I can
(maybe not the compiler part).

Eric




Acknowledgement sent to Eric Abrahamsen <eric@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#50219; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 29 Aug 2021 19:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.