From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: cond* Date: Wed, 20 Dec 2023 23:20:22 -0500 Message-ID: References: Reply-To: rms@gnu.org Content-Type: text/plain; charset=Utf-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9345"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Adam Porter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 21 05:21:08 2023 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 1rGAYW-0002J9-Ej for ged-emacs-devel@m.gmane-mx.org; Thu, 21 Dec 2023 05:21:08 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rGAXo-00040L-9K; Wed, 20 Dec 2023 23:20:24 -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 1rGAXm-0003zJ-NJ for emacs-devel@gnu.org; Wed, 20 Dec 2023 23:20:22 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rGAXm-00054u-C3; Wed, 20 Dec 2023 23:20:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=NZ/dHYw4/9T8gBe8FhutmMFeGZ+9kIN8Ao8AjYSTUZ4=; b=rvvBuFdAdzLb AV/7dIJBBJpoVktCShy0MOvQKTeZxY/2TNunBvc7X5js/CbSPs4gfXvGvuVENk/JZEANKNtOod/XK fJsuQWXvopSfSASB0dplxkjCt9/dSkj2dOPfgdM2Ta+AZWC2W7D88L0DuwMAHT8rdeJ36Ybb7QQoO RDRWS8GAlDvvjOVDBpdgZJMEMw6XHLATSTDJ4DcIgg8eLGil/ne+Z07BBf1WQ83EZX/Q/IIYI2GkJ 3LUBplEu9hSLR6mnyVp3lRez1M7k1g3YCA+xnPo+0Cwk+0T/s6d4TVr4GzCY9dQe86pjZPdn3bQcS WqzANu6aY50Hhp+g21gZww==; Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1rGAXm-0006pf-3B; Wed, 20 Dec 2023 23:20:22 -0500 In-Reply-To: (message from Adam Porter on Sun, 17 Dec 2023 23:41:22 -0600) 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:314025 Archived-At: [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > Well, one of the most common things I do with pcase is to destructure > alists, plists, and structs, often nested at multiple levels. For example: These examples don't use pcase. They use pcase-let*, which I am not familiar with. Although I now understand simple pcase usage, I can't relate what I see in these examples to that. I can't understand them at all. If you explain to me what these examples do, and how they do it, I might understand them enough to think about them. As for pcase-let* in itself, its doc string is clear enough. It uses a series of bindings of the form (PATTERN VALUE). We can do that naturally in cond* like this: (cond* (t (match* PATTERN VALUE)) (t (match* PATTERN2 VALUE2)) ... (t BODY...))) so I think cond* avoids the need for a separate ...let* construct. -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org)