From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Akira Komamura Newsgroups: gmane.emacs.bugs Subject: bug#59900: 30.0.50; map pattern in pcase causes a byte-compile error Date: Fri, 9 Dec 2022 16:58:28 +0900 Message-ID: References: <877cz22v26.fsf@gmail.com> <83ilim2lyz.fsf@gnu.org> <87k031nx6l.fsf@web.de> <837cz1125q.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000008810eb05ef608515" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24745"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Michael Heerdegen , 59900@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 09 08:59:26 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p3YI2-0006Ea-Hq for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Dec 2022 08:59:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3YHj-0005A3-O1; Fri, 09 Dec 2022 02:59:07 -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 1p3YHf-00059k-CT for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 02:59:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p3YHe-0005z3-UJ for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 02:59:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p3YHe-0004IQ-EK for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 02:59:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Akira Komamura Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Dec 2022 07:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59900 X-GNU-PR-Package: emacs Original-Received: via spool by 59900-submit@debbugs.gnu.org id=B59900.167057272816504 (code B ref 59900); Fri, 09 Dec 2022 07:59:02 +0000 Original-Received: (at 59900) by debbugs.gnu.org; 9 Dec 2022 07:58:48 +0000 Original-Received: from localhost ([127.0.0.1]:34428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3YHP-0004I8-JA for submit@debbugs.gnu.org; Fri, 09 Dec 2022 02:58:47 -0500 Original-Received: from mail-ej1-f42.google.com ([209.85.218.42]:40729) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3YHN-0004I1-VX for 59900@debbugs.gnu.org; Fri, 09 Dec 2022 02:58:46 -0500 Original-Received: by mail-ej1-f42.google.com with SMTP id b2so9620827eja.7 for <59900@debbugs.gnu.org>; Thu, 08 Dec 2022 23:58:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=xUWO1O5mb2cjdslRhosqmi8h6gafNjEmQ/fqb0ck7sc=; b=E0p69U5gyv8AXiz1pHt4Hpv7uWvN/40k91DiaQLwaxNd3+igEJQoxpUBUna4cwxP65 X1ViPUfvzev5U7dY0rnqwfEl1o1IoWMg/xK2jh6LFzUaFhzKL3q8TWwEa2gh27L4ThCt d2zW7pGk8AMUkTJlfBdOe1I1g2GZggNH7ClUDy1pxGwiDXGRPxCdhuZmqHAlxul/X16r mGe3sYZus1nokuXLdXPHFJt6KA1yopmmSr/fgmeHxs8YdUgi6rtrxblmeKVqmZBSFibz q7vjge074HpSH9OBjBOgsrk/clCKscdPfWi0FuW/5Sbk39CYlrzFEPGKHwj9giOKip2A 6Brg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xUWO1O5mb2cjdslRhosqmi8h6gafNjEmQ/fqb0ck7sc=; b=M+Ch7d1uhcmWROVA35qNpBgZ92YQHQ8gKlSsW0mlTufnalmfgbSpEUwke2yaRBohFe KNzvplVcw+5jxotQhtdRJoXVnsy+Rx9mAesXiL7JPw/g4HqYMnSFLunMVgukBFU8LA4Y k8E/NJUCw0PKbj0+f09rMHnx/NvUlB8c//NTKq0fWB9bN8HihdkVaenwU1iI31RKlT3T p+VKbvXEVxcfQe3AUuYfsJ5/xdfUwnx4+K05+3CAwZN51dtGQAl/11Z8uY+plQJvi6wj 0VKvCOuznD2RqMXwaLI51HHFLWo+OGeONI7Amw9WXJV40pzOu6INQSs3C5vRNfdKLYmQ +hEw== X-Gm-Message-State: ANoB5pmLJnAYisYJk0hn5yaHtU4EGZXXiZASdB4jS10IEFLNP1iC1Ofi 72jlgtlN2TEDIzuyw+tYq5lgSlaSVcmtqt/9uSU= X-Google-Smtp-Source: AA0mqf5RSZP+s28KzF+q1E52Oww2XSQxM6bbZ64Og4Zj62XljFOS/aNMca1q8dzHs3djsnV31J1qjBrZtBgQ+ReTWNs= X-Received: by 2002:a17:906:5055:b0:78d:cdce:bc52 with SMTP id e21-20020a170906505500b0078dcdcebc52mr66339207ejk.469.1670572719734; Thu, 08 Dec 2022 23:58:39 -0800 (PST) In-Reply-To: <837cz1125q.fsf@gnu.org> 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:250366 Archived-At: --0000000000008810eb05ef608515 Content-Type: text/plain; charset="UTF-8" On Fri, Dec 9, 2022 at 4:12 PM Eli Zaretskii wrote: > Thanks, but all this still doesn't answer my questions, > unfortunately. You-all are describing something that I cannot wrap my > head around, because that basic question was not answered yet. > > Would someone please take me through the problem step by step? > There is a MELPA package depending on `pcase'. It contains a `map' pattern: (pcase-let* ((`(,_name . ,(map filename outline-path id front-context-string indirectp)) ...) The support for `map' pattern is not built into `pcase.el'. Instead, it is enabled through `pcase--get-macroexpander', which is implemented as follows: (defun pcase--get-macroexpander (s) "Return the macroexpander for pcase pattern head S, or nil." (get s 'pcase-macroexpander)) It returns `pcase-macroexpander' property of the symbol (i.e. `map' in this case). The property should be available at compile time. If not, the library will fail to byte-compile. To set the property of an additional pattern, `rx', `map', `seq', etc. all use `pcase-defmacro'. I think autoloading the `pcase-defmacro' form in `map.el' can prevent the error as well as possible future errors in other libraries. This is already done in `rx.el'. --0000000000008810eb05ef608515 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Dec 9, 2022 at 4:12 PM Eli Zaretskii <eliz@gnu.org> wrote:
Thanks, but all this still doesn't answer my q= uestions,
unfortunately.=C2=A0 You-all are describing something that I cannot wrap my=
head around, because that basic question was not answered yet.

Would someone please take me through the problem step by step?

There is a MELPA package depending = on `pcase'. It contains a `map' pattern:

(pcase-let* ((`(,_n= ame . ,(map filename outline-path id front-context-string indirectp))
= =C2=A0 ...)

The support for `map' pattern is not built into `pca= se.el'. Instead, it is
enabled through `pcase--get-macroexpander'= ;, which is implemented as follows:

(defun pcase--get-macroexpander = (s)
=C2=A0 "Return the macroexpander for pcase pattern head S, or n= il."
=C2=A0 (get s 'pcase-macroexpander))

It returns `pc= ase-macroexpander' property of the symbol (i.e. `map' in this
ca= se). The property should be available at compile time. If not, the library<= br>will fail to byte-compile.

To set the property of an additional p= attern, `rx', `map', `seq', etc. all use
`pcase-defmacro'= ;. I think autoloading the `pcase-defmacro' form in `map.el' canprevent the error as well as possible future errors in other libraries. Th= is is
already done in `rx.el'.
--0000000000008810eb05ef608515--