From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: combining cond and let, to replace pcase. Date: Sun, 19 Nov 2023 15:08:22 +0200 Message-ID: <83v89xki0p.fsf@gnu.org> References: <878r6u3s7f.fsf@web.de> <831qcmklys.fsf@gnu.org> <87v89x3o19.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24439"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 19 14:09:31 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 1r4hYJ-0006Aq-8P for ged-emacs-devel@m.gmane-mx.org; Sun, 19 Nov 2023 14:09:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r4hXX-0001AZ-NH; Sun, 19 Nov 2023 08:08:43 -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 1r4hXU-00019w-KF for emacs-devel@gnu.org; Sun, 19 Nov 2023 08:08:40 -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 1r4hXU-0007pK-49; Sun, 19 Nov 2023 08:08:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=p8q10rpHK5HVevbpzLNjT3EW3i1JWY0hsZYmTXkrEY8=; b=GpM4VI7xzyiDzNtPRMC6 GJPFCVrQ+4sjos5BM2SYVXnN71aNsr1HJyeDs11UfzCCo0cpxaf/lbtlNxhj1C5HhyNBJnV7L+9AD WUywexwxHf9cUUwattJ5XbdsMWKU9AphPv/MUH367+/ypMJtWmvYJVqmpHS19WIuikr6FspzNbk2L xWdrdKRbhTU5pwHogF+J6EEPaXXcM0YquXqxMXMc0VG6TuVZL9/DhQl4TclhJgYYWtP1B56GM1jYR 6R8nkP4YOvV3oBj6NWNj/Y91tCLCygA1J5zXUAJnBc7OhnX+10JMjvjp0C/Ei/SNzVbxUQBgKlY9a kvTwsg6Pypx4ZQ==; In-Reply-To: <87v89x3o19.fsf@web.de> (message from Michael Heerdegen on Sun, 19 Nov 2023 13:50:26 +0100) 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:312971 Archived-At: > From: Michael Heerdegen > Date: Sun, 19 Nov 2023 13:50:26 +0100 > > 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. Code that is hard to read, even if only to some of the people, is a problem for us, since we are a project that advances mainly through sporadic contributions of people who tend to disappear after a relatively short time. > I accept that people having a problem reading code involving pcase is a > problem. So we agree. Then arguments about how easy pcase is for some are not relevant, because this is not what this is about, right? > > 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? The string, of course. > 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. It isn't only that. It is also that the obscure and subtle nature of regexp strings makes it easy to make mistakes. Just look at the sheer number of regexp mistakes uncovered in our code base by Mattias EngdegÄrd during the last year. It isn't an accident. > The amount of knowledge you need to remember, the amount of > documentation you need to consult, is the same. The rx notation is easier to read and interpret, at least for some, and I submit leads to fewer mistakes. So no, I don't agree that it is "just the habit", and nothing else.