From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Kisaragi Hiu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#68345: 29.1; cl-defstruct'ed struct errors out in the constructor compiler macro if a slot is called "quote" Date: Tue, 9 Jan 2024 21:32:06 +0900 Message-ID: <05766552-b1d9-44b6-99fb-6f13c4601746@kisaragi-hiu.com> Reply-To: Kisaragi Hiu Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29825"; mail-complaints-to="usenet@ciao.gmane.io" To: 68345@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 09 13:33:22 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rNBIG-0007TE-V1 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Jan 2024 13:33:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNBHu-0000hm-Ex; Tue, 09 Jan 2024 07:32:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNBHt-0000ha-Fd for bug-gnu-emacs@gnu.org; Tue, 09 Jan 2024 07:32:57 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNBHr-0003p7-Aq for bug-gnu-emacs@gnu.org; Tue, 09 Jan 2024 07:32:56 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rNBHy-0005WR-2w for bug-gnu-emacs@gnu.org; Tue, 09 Jan 2024 07:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Kisaragi Hiu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Jan 2024 12:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 68345 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.170480356221199 (code B ref -1); Tue, 09 Jan 2024 12:33:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Jan 2024 12:32:42 +0000 Original-Received: from localhost ([127.0.0.1]:38596 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNBHe-0005Vr-B9 for submit@debbugs.gnu.org; Tue, 09 Jan 2024 07:32:42 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:43968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNBHb-0005Vf-Jw for submit@debbugs.gnu.org; Tue, 09 Jan 2024 07:32:40 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNBHO-0000gO-0n for bug-gnu-emacs@gnu.org; Tue, 09 Jan 2024 07:32:27 -0500 Original-Received: from out-186.mta1.migadu.com ([2001:41d0:203:375::ba]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rNBHI-0003Xf-6p for bug-gnu-emacs@gnu.org; Tue, 09 Jan 2024 07:32:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kisaragi-hiu.com; s=key1; t=1704803532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V8LsgcJmhL/nsnzMZVP/FqvTw7+Y/vJN8QfmMRZiTL4=; b=eU9jemz5PIIFJGA70ouj9dJyRr/fcVUpvJRpWBJ4A/IpWz2bejb6byEQup1bmdHvYWKyQt wUjc87/hNYjAvdMCI7g3bL0aFeJVzunsU1tIb0jexMpFp+g8chAgWI06K/DcT1T+P953L8 jIdTQZiIOlVNy8LgLdAJgaLq8XkwUi1uYT4Z6TWOUCDHSax1cTL60ejsCKE88IUy87nn7N UVAcPRRPi/oNbfkijcnm3R/LrbqVIzQvDNaP/JF90B1xkfFdfu8Kf878NhaVzJbOCv3YqG V4TlVff3pdWee8YtDD6aVI4lTxiDyBOtxkb7poG0Fj1DFMCfF8GOK7kgjFX/pw== Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:203:375::ba; envelope-from=mail@kisaragi-hiu.com; helo=out-186.mta1.migadu.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:277621 Archived-At: * The problem If a struct is defined to have a slot called "quote", the constructor will fail during the compiler macro phase. (require 'cl-lib) (cl-defstruct my-test quote) (make-my-test :quote "'") ; error: (invalid-function "'") (put 'make-my-test 'compiler-macro nil) ; disable the compiler macro (make-my-test :quote "'") ; => #s(test "'") I have tested Emacs 25.3, 26.3, 27.2, 28.2, and 29.1; this error is in all these versions. * Why this is a bug This feels like a bug to me, because it's not clear that this would be an unsupported use case, and because of the inconsistent behavior between the constructor being inlined vs. without a compiler macro. * Potential directions This could be "fixed" by either digging into cl-defstruct and cl-lib then fixing it properly, or by simply declaring in the documentation that this is not supported. I wish for a proper fix, but the documentation workaround also seems fine to me. * Additional info This is what the compiler macro for make-my-test expands into: (cl-block make-my-test (record ("'" my-test) "'")) In GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.8) Windowing system distributor 'The X.Org Foundation', version 11.0.12101010 System Description: Arch Linux