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?= <joaotavora@gmail.com>
Newsgroups: gmane.emacs.bugs
Subject: bug#67611: [PATCH] Add a Pcase pattern `cl-lambda` equivalent to
 `cl-destructuring-bind`
Date: Wed, 17 Jan 2024 09:12:07 +0000
Message-ID: <CALDnm51LhM6WTFN22tw0NrEo7koRPk8Bf0Vu-2=8g+idGQj69Q@mail.gmail.com>
References: <277dd49a-e96d-4faf-a22e-aca952354a37@protonmail.com>
 <jwvplzllrrm.fsf-monnier+emacs@gnu.org>
 <30f1bf76-1cf1-493e-be4f-38e405d0ecf6@protonmail.com>
 <CADwFkm=7bc5__WNzZftWt01cnQt4NpnFez+LmqJo9qnieN2nCQ@mail.gmail.com>
 <CALDnm51VjpjCp4xLPfQ-qR1iwxdDc5XX0i3=8M1vW6vUDizMTw@mail.gmail.com>
 <jwvwmsfntmc.fsf-monnier+emacs@gnu.org>
 <CALDnm52=voD5PrnsU58wQR1omwymYdUALEAueqsQTZujU6i0rQ@mail.gmail.com>
 <jwvle8uefqj.fsf-monnier+emacs@gnu.org> <E1rOqrI-0007yP-Kg@fencepost.gnu.org>
 <875xzw4ngq.fsf@gmail.com> <E1rPwcn-0004ln-Ml@fencepost.gnu.org>
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="12350"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: 67611@debbugs.gnu.org
To: rms@gnu.org
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 17 10:13:25 2024
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
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 <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1rQ1zB-00030S-2J
	for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Jan 2024 10:13:25 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces@gnu.org>)
	id 1rQ1yt-0006lU-SR; Wed, 17 Jan 2024 04:13: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 <Debian-debbugs@debbugs.gnu.org>)
 id 1rQ1yp-0006kD-Rl
 for bug-gnu-emacs@gnu.org; Wed, 17 Jan 2024 04:13: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 <Debian-debbugs@debbugs.gnu.org>)
 id 1rQ1yn-0005yo-Jt
 for bug-gnu-emacs@gnu.org; Wed, 17 Jan 2024 04:13:03 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1rQ1yo-0002fD-7U
 for bug-gnu-emacs@gnu.org; Wed, 17 Jan 2024 04:13:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?=
 <joaotavora@gmail.com>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Wed, 17 Jan 2024 09:13:02 +0000
Resent-Message-ID: <handler.67611.B67611.170548274910183@debbugs.gnu.org>
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.170548274910183
 (code B ref 67611); Wed, 17 Jan 2024 09:13:02 +0000
Original-Received: (at 67611) by debbugs.gnu.org; 17 Jan 2024 09:12:29 +0000
Original-Received: from localhost ([127.0.0.1]:50728 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1rQ1yG-0002eB-Kv
 for submit@debbugs.gnu.org; Wed, 17 Jan 2024 04:12:28 -0500
Original-Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]:54335)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@gmail.com>) id 1rQ1yE-0002dx-Bq
 for 67611@debbugs.gnu.org; Wed, 17 Jan 2024 04:12:27 -0500
Original-Received: by mail-lj1-x22f.google.com with SMTP id
 38308e7fff4ca-2cd1232a2c7so134451631fa.0
 for <67611@debbugs.gnu.org>; Wed, 17 Jan 2024 01:12:25 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1705482739; x=1706087539; 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=JDbEsj5GDUeiuE0Q5bz0veKc/d0wuHIbThkqpkkKm7w=;
 b=Iovfe/ZIGF7aB082fefn2Ahy8doA7142zg/zR0o/nexdt61Uj+Hj4YNza38ydx2UV1
 ETRbKXgefGG6u+iQnZwwEJmMQKdgKivUvhay31pfxJsI8Sn0K9MGE6J5anPSvlqmgFiy
 5AWV/9Ouf7LB6DswgumPHDnFuC37/zlb9IbEyzcKYPanr0UOesgfr31tuC/w3UGRL2UQ
 2MHcxkDhozRUqdrrwHskKbgQAb6Q/pJ8NNyyT6azbyeTME9mt4XsTyPB/huRjJeqWrZl
 BEwXZvvg1tA1JKCCnyqPLU7GnCgpA+XkhCeGcpP0smDwURIrayrJOYzH1e7m6Eg3DvrK
 2HAA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1705482739; x=1706087539;
 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=JDbEsj5GDUeiuE0Q5bz0veKc/d0wuHIbThkqpkkKm7w=;
 b=WI1VL8whZXmy8tl5rEpaRPVCDSm316FkHBJunkD9Eo8QIPoiWS5RtYJjtQ+/+RrPYQ
 XFUtu2JyXL/zr3FcPcYw/c5daDObJdulDWg3eLQd+PdKUQAxdKRocqNYY+vvgs3bxDmY
 vsrmH2zZwteIdhYxE1W8OB6A/c3ggp3HKsgdTE3mDZRKRr0YAZH4myRdlH5V6d7e26pm
 J/HbqoxfA8xdfL8R76s6tw2KgHcQbzg8Kb6mM4ZFh25SeNxA1f0pW7b3fR5wmO2MeG2w
 BKTBbVQf3+44zrRTtpsp1CumDtto6YGeYB0FNhPoXhLLDf+jqtc2FpHhC1OA3gYl8rpY
 CUVw==
X-Gm-Message-State: AOJu0Yw4ZSXSvxlo1DPZr3SlSD/Rr56Ci+dmEBWF16REMFMamSNBkl91
 rNRUlmIwrCrnOikoCarXqr9tJEbZKlIQd07UHoE=
X-Google-Smtp-Source: AGHT+IHucw+c02qTnRNC425CqT7rRT835Y+LfQs9VY3r4owEKHZ6YiTvkz129XzfaEB5hCbWHjFHWSmzx9rl6tF6zYY=
X-Received: by 2002:a2e:8e8c:0:b0:2cd:4c67:d3f1 with SMTP id
 z12-20020a2e8e8c000000b002cd4c67d3f1mr3821133ljk.102.1705482739230; Wed, 17
 Jan 2024 01:12:19 -0800 (PST)
In-Reply-To: <E1rPwcn-0004ln-Ml@fencepost.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" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=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:278377
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/278377>

On Wed, Jan 17, 2024 at 3:29=E2=80=AFAM Richard Stallman <rms@gnu.org> wrot=
e:

> Could you tell me more concretely what this proposed feature would
> look like in use?  Perhaps with an example including context?

Many examples in the patch, have you looked?

> pcase does not use lambda lists, and neither does cond*.

Pcase it extensible for any object structure the user may
think of you can think of. This proposal is an extension.

Here's an example

(pcase some-mistery-object
   ((cl-arglist (42 &key a b c))  ; this proposal
    (message "Oh, it starts it 42 and has c=3D%s" c))
   (`(,_ ,x ,_)
    (message "Boring three-element list with middle %s" x))
   (`[,_ ,x ,_]
    (message "Fancy vector with middle %s" x))
   ((franklinboing (nixneez)) ; my data-structure
    (message "This franklinboing has some nice nixneez %s=3D" nizneez)))

Jo=C3=A3o