From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: combining cond and let, to replace pcase. Date: Sun, 19 Nov 2023 12:20:20 +0100 Message-ID: <878r6u3s7f.fsf@web.de> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38917"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Spencer Baugh , emacs-devel@gnu.org To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 19 12:21:24 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 1r4fre-0009o4-U3 for ged-emacs-devel@m.gmane-mx.org; Sun, 19 Nov 2023 12:21:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r4fqr-0003mH-GR; Sun, 19 Nov 2023 06:20:33 -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 1r4fqc-0003lr-Ej for emacs-devel@gnu.org; Sun, 19 Nov 2023 06:20:20 -0500 Original-Received: from mout.web.de ([212.227.15.4]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r4fqZ-0002f8-9k; Sun, 19 Nov 2023 06:20:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1700392807; x=1700997607; i=michael_heerdegen@web.de; bh=c5/WjHiyXnwk8Q55xCOo8WOSa92hYBkS3YerN4jPczw=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References: Date; b=LTt3oD3Qf2FLsjOPS3cZT2WU0A6IvfqLiJwdYrGib4uAGPOJC99XfX19gFtMeIj3 FvqEmTU4Ixm8Tl2MmaxuzVgbwflq6t7obXjjpV3Bbn+lPK55G81HBnhOweCc7I3zr VZPyyq5F+D7BFj+fDtUT2/HcrVtZwfnjRE7vnmXM8ckbKgtrvj89xTfIdOYyXM4gB Zpepp3BK3/WkOQJE8Zc0wj1okPbS8Ku1hFQWBB1by4KZ2msHKB5ixrgGJpujpZy7U UL0kbAbQpJXAQWsusnNuIx9qoN9GtXbXdEsoqIOiKqNhFGzF9mA7DymhVUo4o6R9Y kf74DziYbJ/5IFBMBA== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Original-Received: from drachen.dragon ([178.6.28.177]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MoNZM-1rfuP83GMy-00oczm; Sun, 19 Nov 2023 12:20:06 +0100 In-Reply-To: (Richard Stallman's message of "Fri, 17 Nov 2023 22:03:56 -0500") X-Provags-ID: V03:K1:m+knz0JyawUu4ZgF+OO9PcxgvqGN05f2B2ssfMFbG6w6souTwdW hzfy/A3V6hcvZu6Mevzlh6YjJCKEfGaE+lVUh20IghzViRTweBBsRCkwNZIgSJKYBo9jOAe aYKgIEw81LnTkPYnDdxJO0+aaYZ7YszvHC0s8iwYhs1KWMx7lKqFObO9XVZWOGcfzHQsnhP Jgw+aemy7ZEZkliJmjrdQ== UI-OutboundReport: notjunk:1;M01:P0:pDBjjKvm6c8=;eJjQFD/ods9Q4/S3vcPUaPZW49B W+PawuKUZ1wa92lfnY04n1sHcwdREWTqwVsO+1KM41B2Bu+jlz85Dgfwye4ZkLsUYH2451JIO SaNoldHb/KGr4GZ+L1wpD7Rz4JCVwgI6UauFCTnTXt/PNh6v7T/Cqmb4keUB9PNeKPsBlpA3D FP7Hoe90v7ND6NxbAa9yA5VK6hN8+4s3JNF1jbFNVyRqgvaTQlQberE6TfMxIgpm5ou5uGSt7 7+FwoZZOFE7gr6HKfY39gAjEoY1U1wIDcZFNoWcbOZhyjxTu2bFUPwS1BoO2UeJJ0OnbkHF1s LNxb3XOOYpSyehfEkFlCxsawvG8a9ZaN5woaHYjT5C107Cx33qxy/dzyAnm+taOrGuDx2d0CK KLIvZCUc0z0acZOvPEaYboZSwDrAol8/pK861NtKkFMDNHcXs6Q13OJZCOUv6jFGY/J4n1J+D iZSE3ZjukNUZYoltitpGy4+mv7z0XeKG+I3//ZKhyLIeUTOWsRSCUp/JfwDAP5W7veF6hrk0D yLNShxNZW1QQyRrN+3d29KUXuho1FFq3bEwKwPMNGwRRXiR+k+bHdAXUn8FL65hy3yUhMmDPl th7GeFefI/o4eBUBNFMCSi9mp/eAHXKVs+hnIoL7Be4nJrukAemrIVIp/pWwG7VMDy3wJ1LrZ Eev5q87sVCFMjLjQrfuPFACGWdGW3qoDEj2rKGS+NDqOrOF+8kjyhkZVtru7cvNUbxr7mGMDX +KumdI+4ZZHdzAS9vpkk1U3T1sm+RJjVwYRl+pIPVfmeoFlMsPsNGo67if5gs9vVPqxXVz19 Received-SPF: pass client-ip=212.227.15.4; envelope-from=michael_heerdegen@web.de; helo=mout.web.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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:312963 Archived-At: Richard Stallman writes: > Some of them could do destructuring as well as matching. > > I hoipe that using a few constructs to divide up the job will avoid > the kludginess of pcase's bells-and-whistles-for-everything approach, > resulting in something equally convenient but made of simple > components. I really don't know how you come to such a conclusion. The original docstring of `pcase' was half of a screen page and it was _complete_. Syntax and semantics are simple, nearly trivial, and consistent. It took one minute for me to learn everything. Then the doc has been extended to the current form adding more prose, in my eyes, it added not a single bit of information. If some people have a problem understanding the abstract approach, this is something different. But a "kludginess of pcase's bells-and-whistles-for-everything approach" does not exist. So please understand that your approach will make the situation worse for others. To me this discussion looks like some people aren't willing to accept multiplication like 10*5 because it "looks strange" and "one would rather write "5+5+5+5+5+5+5+5+5+5" because this would be much simpler and we don't need this strange "*" at all. Is this unfair? I don't know. But are there any _objective_ reasons why the design of `pcase' would not be optimal? To me this all looks more like being based on vague feelings because the approach is a bit different from what people are used to. But the approach is extremely simple. I think that replacing it with multiple other tools would complicate the matter. Any additionally defined pcase macros are a different thing of course. They extend pcase patterns to a richer but more complicated mini-language. You need to remember more definitions. OTOH, this is not a design fault of pcase patterns: any matching tool that wants to provide specialized tools to support matching of special things (like structs) will have to extend the semantics in one way or the other, and necessarily complicate the tool(s). To sum up, I question your premise of this discussion. In my opinion `pcase' comes very close to the optimal solution for its task. For some reason, people don't accept the backquote syntax it uses, although it perfectly fits the task of destructuring. I just don't understand it. People get crazy about that backquote. Dunno what's the matter with it. But it seems this is one of the main problems. Michael.