From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#67611: [PATCH] Add a Pcase pattern `cl-lambda` equivalent to `cl-destructuring-bind` Date: Sat, 13 Jan 2024 00:58:49 -0600 Message-ID: References: <277dd49a-e96d-4faf-a22e-aca952354a37@protonmail.com> <30f1bf76-1cf1-493e-be4f-38e405d0ecf6@protonmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24123"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Okamsn , 67611@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 13 07:59: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 1rOXzE-000696-AY for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Jan 2024 07:59:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rOXz0-0001Ma-Lm; Sat, 13 Jan 2024 01:59:06 -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 1rOXyy-0001M7-J6 for bug-gnu-emacs@gnu.org; Sat, 13 Jan 2024 01:59:04 -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 1rOXyx-00007W-9S for bug-gnu-emacs@gnu.org; Sat, 13 Jan 2024 01:59:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rOXyv-0008Eh-M3 for bug-gnu-emacs@gnu.org; Sat, 13 Jan 2024 01:59:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Jan 2024 06:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67611 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix notabug patch Original-Received: via spool by 67611-submit@debbugs.gnu.org id=B67611.170512914131652 (code B ref 67611); Sat, 13 Jan 2024 06:59:01 +0000 Original-Received: (at 67611) by debbugs.gnu.org; 13 Jan 2024 06:59:01 +0000 Original-Received: from localhost ([127.0.0.1]:38231 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOXyu-0008ES-N6 for submit@debbugs.gnu.org; Sat, 13 Jan 2024 01:59:00 -0500 Original-Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]:57850) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOXyo-0008EB-SW for 67611@debbugs.gnu.org; Sat, 13 Jan 2024 01:58:58 -0500 Original-Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5574feb7958so8350411a12.3 for <67611@debbugs.gnu.org>; Fri, 12 Jan 2024 22:58:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705129130; x=1705733930; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:from:to:cc:subject:date :message-id:reply-to; bh=B7UCoj0NthDkQ+1BloMup+U6UHzQSS94/D0othxCGxY=; b=hVWWSrjAmjxrwHd29PxBFzyN3+f3lfrREsuDaAheLiDg4xIl0aHnztFIxjNPuPOd2I 2VjVDH65W3AH2jd6nkiA41dHacqtSqU8Ev89ifuqaCaaz20i3TDkMU6yb/kt0IbFYwj8 az6ZwJM9hM9OlynxyGtM9kfCMAuArYvuABWhC6IW8nMIg3OgllKbK8xyDzSKBhkd2YmQ 9ETcE7DrGgYtF7BcOGbpygpSg+Z7lOf8ypVvvP5oRFibme7hqszHE0hf8Uh9JVBwQkgI cRXhojCeMM20hDCT4Ax7Slp3yuv0v08naCcip+2lQdLFarsVDVBjF6h8byWaOAk8/W77 QbQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705129130; x=1705733930; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=B7UCoj0NthDkQ+1BloMup+U6UHzQSS94/D0othxCGxY=; b=DrzPcUyCNeij78JdMy+HR8A8DRVqg7CeVj+sOhx0xqyVzksQIxly+wlWAM7iWIC9Hs vXj8HQNEdy3oruhqoKsdRG6ngjs/7lJ1V4hdiDg/jzLBzmUX2ef6aeU9Weyo/0gZxEMk WSBb/xWzshL6ORy4o54C7XafO55+cwtMx3jjyq09cuRVtZLzg8hXbh96TY6YgFim4IwT rPl/T76W+euDdl9GtdipaY2p0C45EuSFOBUvize/bVK79e4JSb0AaYWtHvRnnvjNd3Be 6cV233m4M+KkZUwQLLbFRnr6dOxRiiQPhMSMY4qdbyk3p/q+KrKYcK9cK6pqEftXHCbq 1ihw== X-Gm-Message-State: AOJu0Yyy/iHeA6Gx07oTVlGwAtghmRQMg7BD8Zsnb2eLaWY/l94QBif8 0872SD7eJ907aLz9ERNIrGwOq2pzSCJiRS0T9OA= X-Google-Smtp-Source: AGHT+IGSYo5LC9Axsm6ek/I69q5IxxI90ebh4iQOZD4Zgnn+TUa1urlIVL5w/A1CgRQcGuhIsQKQKSpi/7pHc1rnZiU= X-Received: by 2002:a05:6402:28a5:b0:558:a602:ae13 with SMTP id eg37-20020a05640228a500b00558a602ae13mr1240722edb.57.1705129130532; Fri, 12 Jan 2024 22:58:50 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 13 Jan 2024 00:58:49 -0600 In-Reply-To: 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:278090 Archived-At: Jo=C3=A3o T=C3=A1vora writes: > Pcase is complicated and hard-to-follow yes. Becasue complex pattern > matching is a complicated thing to express, just as regular expressions > are such a thing Pretty much, yes. We could improve its documentation though. We could add a tutorial to the ELisp manual, for example (probably not included in the printed version). > If you ask me, we'd be better off designing an "explain pcase" > utility or designing font-lock rules that helps explain it. > > The byte-compiler is already traversing that anyway and flagging > unused variables and stuff. Can't we use this to mark what is a > lexical variable and what is a literal symbol, for example? Can't > we have a very clear highlighting of the pcase extension being > used, like highlighting the '`' or the 'cl-arglist' or the 'seq'. That would be very useful to explore, I think.