From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Code for cond* Date: Wed, 24 Jan 2024 12:08:21 -0500 Message-ID: References: <1AD5807F-91F7-4B92-BCB0-D0FEA904A75D@gmail.com> <8E0D0E7B-B733-4CB7-A34D-7FE80D3AB52D@gmail.com> <5079C75B-D729-4732-8C87-DA2DE4FA2BDE@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38028"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Stefan Kangas , emacs-devel@gnu.org To: JD Smith Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jan 24 18:10:13 2024 Return-path: Envelope-to: ged-emacs-devel@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 1rSglR-0009dy-6x for ged-emacs-devel@m.gmane-mx.org; Wed, 24 Jan 2024 18:10:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSgku-0006NW-Q5; Wed, 24 Jan 2024 12:09:40 -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 1rSgkr-0006G6-HO for emacs-devel@gnu.org; Wed, 24 Jan 2024 12:09:38 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSgko-0002MD-JR for emacs-devel@gnu.org; Wed, 24 Jan 2024 12:09:36 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 9C6514445E0; Wed, 24 Jan 2024 12:09:31 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1706116170; bh=p+YeVre48HFJL9er7/jwUhG3+m9AJhAko4aSDyyYmR4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=TYNIKFEbvaaElkT9elv45aoy5mECiuqNgnzuTm2Miimt+WQs4WTj3vLRZhNnj+eKN 71YvV/lPI6VFzGe+J/XuG8FBgYalFG9PvOMmp+aah58tIkprwsdqqbuB42Br8N54k3 Paq5LGuVmVURH7OiZNf4xcy23Mbk+K3FeKD7MnWv0GXOegu/DkeZUbe8IgPV0Xcxyq X8MrWQoh9cQUfKB7wO4tMPZ5suM0uOJL0zueWb3MV+rsPVH3RTVYfy2GB7KpdkXPLs I1Dsu+QLBCqnnHGLpNr3FxzcG0fpjYdr95xaAqZDohEbVDGJz1sAkoGHraq018avNM ddKWqxiZGRA1w== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5A4BA4445E2; Wed, 24 Jan 2024 12:09:30 -0500 (EST) Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4B39C1201E6; Wed, 24 Jan 2024 12:09:30 -0500 (EST) In-Reply-To: <5079C75B-D729-4732-8C87-DA2DE4FA2BDE@gmail.com> (JD Smith's message of "Wed, 24 Jan 2024 11:20:38 -0500") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:315327 Archived-At: >> returns the same `(foo moo loo . boo)`, so there is not a unique way for >> a pattern like `(,@list-var . ,other) to match a given list. >> That's a large part of the reason why ,@ is not supported in Pcase's >> backquote patterns. > Not a unique way without a policy, but could it not take the largest > possible list at that position, ala regexp greedy matching? Of course, if you absolutely want that feature, you can define a meaning for it. But it does make it somewhat different in nature to the rest of the patterns. Another difference is that it will allocate new objects rather than just select fields from the object under scrutiny. BTW, this is all implementable right now without any change to `pcase.el`: just write the corresponding `pcase-defmacro` :-) Stefan