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 13:50:26 +0100 Message-ID: <87v89x3o19.fsf@web.de> References: <878r6u3s7f.fsf@web.de> <831qcmklys.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18906"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: emacs-devel@gnu.org Cancel-Lock: sha1:l73Tw5rxknACC53lhAgs1oONasI= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 19 13:51:38 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 1r4hH0-0004iz-7G for ged-emacs-devel@m.gmane-mx.org; Sun, 19 Nov 2023 13:51:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r4hFx-0003Pe-4S; Sun, 19 Nov 2023 07:50: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 1r4hFs-0003PC-HU for emacs-devel@gnu.org; Sun, 19 Nov 2023 07:50:28 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r4hFq-0006gA-4g for emacs-devel@gnu.org; Sun, 19 Nov 2023 07:50:27 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1r4hFm-000390-Si for emacs-devel@gnu.org; Sun, 19 Nov 2023 13:50:22 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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:312969 Archived-At: Eli Zaretskii writes: > > To sum up, I question your premise of this discussion. > > Don't. It's a real issue. Maybe not for you, but for some others. > No one in their right mind would assume that Richard has "a problem > understanding the abstract approach". Just look at which pieces of > software he wrote and the various DSLs he designed while at that. So > when Richard, of all the people, tells us there's a problem, I suggest > that we listen, especially since a few other veteran Emacs developers, > who are not unfamiliar with Emacs Lisp and its subtleties, tell > something similar if not identical. There is a problem. And I see it. I already said that. But the problem is "some people can't read pcase calls well". The problem is not "pcase is bad". The latter is a subjective conclusion, and this is the part I do not accept as objective truth. And this makes a difference to how we aim to find a solution. Maybe we people actually understanding pcase could also contribute something to a solution? This is not possible if "pcase is badly designed" is the starting point of the discussion that everybody should take as granted objective truth that is meant to be blindly accepted - I don't do that. I accept that people having a problem reading code involving pcase is a problem. > The same is true for regular expressions. But we still have rx, and > some people really prefer it. Maybe this imperfect analogy will help > you understand the issue with pcase. This is an excellent analogy. Which one is the counterpart to `pcase'? `rx' or the string form? Actually both and none, this is exactly the point I raised in my other reply - both have exactly the same complexity, and it is totally subjective and only habit which one you prefer. The amount of knowledge you need to remember, the amount of documentation you need to consult, is the same. And although the string form is normal Lisp (strings are expressions), this fact makes the thing not any easier to use, not a tiny bit. The complexity is in the task. And hidden in the algorithm that runs after you have specified the pattern/the regexp in whatever language you prefer. Michael.