From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#67611: [PATCH] Add a Pcase pattern `cl-lambda` equivalent to `cl-destructuring-bind` Date: Tue, 5 Dec 2023 09:21:47 +0000 Message-ID: References: <277dd49a-e96d-4faf-a22e-aca952354a37@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="13470"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Okamsn , 67611@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 05 10:23:17 2023 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 1rARdz-0002u7-0S for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Dec 2023 10:23:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rARdq-00082l-Br; Tue, 05 Dec 2023 04:22: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 1rARdm-00081o-AY for bug-gnu-emacs@gnu.org; Tue, 05 Dec 2023 04:22:54 -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 1rARdj-0003HO-A9 for bug-gnu-emacs@gnu.org; Tue, 05 Dec 2023 04:22:51 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rARdu-0002ia-9l for bug-gnu-emacs@gnu.org; Tue, 05 Dec 2023 04:23:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Dec 2023 09:23:02 +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: patch Original-Received: via spool by 67611-submit@debbugs.gnu.org id=B67611.170176813710395 (code B ref 67611); Tue, 05 Dec 2023 09:23:02 +0000 Original-Received: (at 67611) by debbugs.gnu.org; 5 Dec 2023 09:22:17 +0000 Original-Received: from localhost ([127.0.0.1]:36609 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rARdB-0002hb-Ew for submit@debbugs.gnu.org; Tue, 05 Dec 2023 04:22:17 -0500 Original-Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:61892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rARd9-0002hK-U9 for 67611@debbugs.gnu.org; Tue, 05 Dec 2023 04:22:16 -0500 Original-Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-50bf69afa99so2520560e87.3 for <67611@debbugs.gnu.org>; Tue, 05 Dec 2023 01:22:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701768119; x=1702372919; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=2wafyPcDSyZDbuNJIQQ8zQ8BOfUh17+C5XwVZ8oluO8=; b=kBAgPbYKCSkoWhooP6HEmK1LgTv0Xt/ubniik1AVgmjM5EwWQ/k10L5gCrKqhM/qXz mnbyc5V6xaVzAf+YYJewpq8aiEjJfOnkYm1Gp3c+NhrZ216GbVpe4kXG7lf+AGIs/WbG Ikjr5415QFas6U91PfHlEX/5fsBw9dk3+Nscwab/jtj9IqI6sq9EzQL+0ngerSZrTRK4 elJHCdngFrlJBXsTqqNTu2WzswbvGqDDPw6F4oWb/YAlDrE/x7JMTZdVwh4ylCvjfjXT qI+iv5KryBnR/9VpHt4nMpQXJrklmMrXbIHD4jjscGAXIUGczl2Lkr31ciuXI6Q6byJA Loxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701768119; x=1702372919; h=content-transfer-encoding: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=2wafyPcDSyZDbuNJIQQ8zQ8BOfUh17+C5XwVZ8oluO8=; b=dinzqU87kZM8hbBVYi/D5JRD0+Zi7wmnPp086439XslIaYEATEGyQsLIC+ZaJiBTeJ N2Trr+78kNkyzaZDq2bTx59Pc9zv8DfvnE6tYPK8UkXE/eaKR1Lhx5O8Hv+HfWr1iJ3Z 1ckFG+lC131SkGRqDfH/7V+CfUF4EPIX2AdeS7lqh1ksvSEWxvaep5jqgsgRfI3KvbvT mT/GxCwAhscH2d/s24s7fAmZ7et893Z3s3t+ekmYtAIAH1xwhNHqlK4I7CgqUDusrWGH Tl+X60ztIyDACmZJp3WeuHGEu/cRda28g5/FJ7ICGK/o6XoWb5Nw8HrWVr7yIvvsjIUq hQbw== X-Gm-Message-State: AOJu0YxpVCwPUjeo7m4ZujBq1XjzWwpH0ltq2A79SmuboCRnGIIqZ8EI JGcEB0fsdBi68r15KiansYTrQ8iv0KiarASwHds= X-Google-Smtp-Source: AGHT+IEH8DA2WbcOzpd2W1ZEgQ/v/6x4xsZrCUe8mN21hCwnCGVCaGelKhEyqNSVqXo9PQx1IxdQkNsvG0qyJDyVH+U= X-Received: by 2002:ac2:4c8b:0:b0:50b:e3c6:60b with SMTP id d11-20020ac24c8b000000b0050be3c6060bmr2553064lfl.92.1701768118671; Tue, 05 Dec 2023 01:21:58 -0800 (PST) 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:275560 Archived-At: On Mon, Dec 4, 2023 at 7:09=E2=80=AFPM Stefan Monnier via Bug reports for G= NU Emacs, the Swiss army knife of text editors wrote: > > > The attached patch adds the pattern `cl-lambda` for Pcase, which works > > like `cl-destructuring-bind`. There are two differences with the lambda > > lists: > > Hmm... I'm not sure mixing the CL destructuring patterns with the Pcase > patterns (both of which are rather featureful and complex) will help > their popularity. > > Beside that problem (which means I'm not very favorable to the > addition), the name should be changed because "lambda" is misleading. > It suggests this has to do with a function (I had to read the code to > understand what this is doing). > > > The pattern is useful when one wants to combine the features of `pcase` > > and `cl-destructuring-bind`, such combining the optional values with th= e > > `pred` or `guard` patterns. > > Do you have examples uses? I for one would like to see some examples too. Okamsn's description of this pcase extension sounds interesting. In fact, it sounds very much like the slime-dcase and sly-dcase macros in SLIME and SLY respectively. Jo=C3=A3o