From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thuna Newsgroups: gmane.emacs.bugs Subject: bug#72328: [PATCH] Nested backquote in pcase Date: Mon, 29 Jul 2024 22:59:03 +0200 Message-ID: <87le1j29uw.fsf@gmail.com> References: <87jzh62vtr.fsf@gmail.com> <877cd5k1ra.fsf@web.de> <871q3d347e.fsf@gmail.com> <877cd4rxqo.fsf@web.de> <87v80o14by.fsf@gmail.com> <87y15kq65n.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17203"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72328@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 30 04:12:20 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 1sYcLb-0004H5-Py for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Jul 2024 04:12:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sYcLD-00062k-Jz; Mon, 29 Jul 2024 22:11:55 -0400 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 1sYcL9-00061I-Vw for bug-gnu-emacs@gnu.org; Mon, 29 Jul 2024 22:11:52 -0400 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 1sYcL8-0003xU-5L for bug-gnu-emacs@gnu.org; Mon, 29 Jul 2024 22:11:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=RYAAEA1BMUoC6YS0FDnQ3HhrYGHu4kSF18Zvz2FB03c=; b=TSGDFw+tWmfJ0TpZCWIh/lSwOFDBMOxItjcpIM4z8Oc4/WfQ8EO+x4u9aTUz8+/9CuN5rgjCEM62lZms4R3v4rHPFsfaKU8nUNwDPawa5bT0jFDZAkSYQzpMgUx5S+EMWYe2+F2H/yg792vA1It0whdXN1qMtm33uE2gTKNwxE3dOq01e5GlcVl5P7NhhTp3Ru/1KyPaYiWm7qE7WGKTUCSiDIBS0+C8QV4shh4GAwUd1Lif0llrrECaaRs2Vhyqhk4YGXPKpclkLLRUd4G1zCIzoEFtemVL7OOrNLuM7qBM0EIF0hyAwUv++F9z3twhUtM/lwR5GoWxIRnmJXah/g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sYcLL-0004tr-M0 for bug-gnu-emacs@gnu.org; Mon, 29 Jul 2024 22:12:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Thuna Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Jul 2024 02:12:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72328 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 72328-submit@debbugs.gnu.org id=B72328.172230547418728 (code B ref 72328); Tue, 30 Jul 2024 02:12:03 +0000 Original-Received: (at 72328) by debbugs.gnu.org; 30 Jul 2024 02:11:14 +0000 Original-Received: from localhost ([127.0.0.1]:46423 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sYcKX-0004s0-QM for submit@debbugs.gnu.org; Mon, 29 Jul 2024 22:11:14 -0400 Original-Received: from mail-ed1-f52.google.com ([209.85.208.52]:49480) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sYcKV-0004rm-Er for 72328@debbugs.gnu.org; Mon, 29 Jul 2024 22:11:12 -0400 Original-Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-5a1337cfbb5so7045042a12.3 for <72328@debbugs.gnu.org>; Mon, 29 Jul 2024 19:10:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722305392; x=1722910192; darn=debbugs.gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=RYAAEA1BMUoC6YS0FDnQ3HhrYGHu4kSF18Zvz2FB03c=; b=jKdAkS5grbBbCcY1Dwlrs40MUJ8yBhN6UoHK0yi3DuOSGWglJcs/u4Fuun5Skiwyqd XBF71CZ501vBh7qi0zwTsiqnDUf19nyZ1MppPlkDaCBnhiasCvJ4w7LXrWK9OKb5FO0o +sGA2FSUXm/nnOa8BZBTb2IONE/GE7OxiiByQ73Qrq4BzfaC6kzjoK8q10EeN/1Tp5Qs 0DnS9yeSJy7vBct9Kk8YPnaE0I+ZTaEFM2dhl92GJ2bkorGsgPadawrtAEr0l+r3Urre SiDd9tASLXV0SYWxXc0BRr9B6rPr8Nu7livDWDjB6nJ/ggj7Hrh3E6YEaZOQMjKjz/t2 Azrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722305392; x=1722910192; h=mime-version: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=RYAAEA1BMUoC6YS0FDnQ3HhrYGHu4kSF18Zvz2FB03c=; b=DoVZbjqoigBO0yaYSkil1K225+bLdYjXP8aWzF9DBHMEcUh3sLG5Wtw1r8ckoxr9Rb dmScILwi/uKEE9z6XJwu7aSuFjqqs27+KtiYGSYszqzrV1Uu2zhjtMyqnebo71/Tc/m3 cKRVn+jWRlWstZWTVmoQJ2sVBQgtxXCSjFvE71qUi7Y0QCzOC8ark24QTRUUa2ZraLP2 SIk6nO9u+zbf4j8tOGTMJA1fNJqb+9iePv+cAjH+G9Z0Ohn2GLXEQs/t2SYpEIdJXIkm HL/Gsthrka4dQL+gjAhlakO4T2OhtIBYu3LouBjI2Sp9b9stKMAkCFTcenEx+u4CN5Cc gMWA== X-Gm-Message-State: AOJu0Yza8QnetLcCeE379LBPDZSlDLT5pxdDKPRRz7mqRwSRTgTfEZoU SKMuvT2FCCB6vQDLUBRliIUxWrp+OEQloYTA6uj3FkYDrnnNG4yo/U5vkHS/cRs= X-Google-Smtp-Source: AGHT+IGzlC3fNjPbULBkUGRsTDBnyUc8Kzws+xr2RiRgjBeFqglBT1x6Z/exejQAKoC4Cv1wrqWPUA== X-Received: by 2002:a17:907:9409:b0:a77:c976:2987 with SMTP id a640c23a62f3a-a7d4006cb89mr600863666b.29.1722286745218; Mon, 29 Jul 2024 13:59:05 -0700 (PDT) Original-Received: from thuna-lis3 ([85.106.105.81]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7acadb7c53sm552049366b.192.2024.07.29.13.59.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jul 2024 13:59:04 -0700 (PDT) In-Reply-To: <87y15kq65n.fsf@web.de> 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:289538 Archived-At: >> I feel like there is a possible misunderstanding. I am not preventing a >> backquote pattern from going deeper into a list. Your example would >> remain perfectly consistent under the new behavior. What *wouldn't*, >> however, is something like >> >> (let ((a 1) (b 2)) >> (pcase `(69 foo `(,bar ,,a ((,,b)))) >> (`(69 foo `(,bar ,,a ((,,b)))) >> (list a b)))) > > Ok - so backquote the macro handles nested invocations of backquote > specially (the nested calls are not expanded individually, only the > outermost backquote expression gets expanded), while the pcase' backquote > implementation is backquote agnostic, it currently treats it like any > random symbol. Your patch tries to adapt pcase backquote to the > backquote macro semantics. Correct? Yes, that is precisely the case. I'm afraid I wasn't able to explain it well enough. > If there aren't any downsides then this makes a lot of sense and would > be a good thing to do indeed. The one downside that I can see is the situation I mentioned in my previous message where you explicitly *want* to bypass all backquotes, plus the fact that this is backwards incompatible, even though to be effected you would need to be making use of the fact that comma behaves this way - which I still don't believe will be too common - though there could be an obsoletion period where comma still bypasses backquotes but warns the user to change off of that behavior. All code making use of the new behavior will firmly be incompatible with older versions of emacs for which this is not patched, however.