From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Instead of pcase Date: Fri, 1 Dec 2023 02:18:00 +0200 Message-ID: References: <87fs169mjj.fsf@posteo.net> <093f11a1-57c2-5e56-d39b-26fef1c67cbb@gutov.dev> <25942.25061.217864.329049@retriever.mtv.corp.google.com> <87zfzdcz6z.fsf@posteo.net> <87zfza2aq2.fsf@web.de> <7nmsv9zq6u.fsf@ecube.ecubist.org> <7nv89x5tsi.fsf@ecube.ecubist.org> <87o7focuf5.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7590"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: michael_heerdegen@web.de, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 01 01:18:56 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 1r8rF9-0001kN-Fm for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Dec 2023 01:18:56 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r8rES-0003A8-Ud; Thu, 30 Nov 2023 19:18:12 -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 1r8rEQ-00039t-J7 for emacs-devel@gnu.org; Thu, 30 Nov 2023 19:18:11 -0500 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r8rEK-00039E-9c; Thu, 30 Nov 2023 19:18:10 -0500 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 17CEC5C0344; Thu, 30 Nov 2023 19:18:03 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 30 Nov 2023 19:18:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1701389883; x=1701476283; bh=JHygBExOl6gQ6wFbt3reDNrwgw/KQZYzPp/ 0oIh8o6U=; b=vboMN63fW+skZJJKn+iJTOFBQo7k1YWhC4S2gLNCs9TWoq/uTdI oTnBm4g088gNopLHogyTvTH89ERwKQ+alpw9yS1mQy2hnspUW5j/Mq2mzVvYx3b4 BQaZAKOlSVznPDpKqp6Tbnv9bJtLfJ/CxlhJyfs3bsBXSo8s2wHCetTYvl9DuEw2 1wm6Vow0JFw44d9JvG/cO9yWZC4ej6T3xZ6+jQU7J1x+VDkn+OgMNoV3JGovKB+q BbgSab4NeIgYFsk+6Sq/2/hInwB6yBAnWcIsg2UV42a4p5UJyu9634zGr3lvm2qD 8mMFBYl12bcmQEd7w8n+sVmWGqQuTzwbahQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1701389883; x=1701476283; bh=JHygBExOl6gQ6wFbt3reDNrwgw/KQZYzPp/ 0oIh8o6U=; b=O2PuzxTdB7ndImnHkA+5jbapUMHJXBD6kAf4X0TuhvRVT9HvOGA WRRB5WLnUZ9ntHAWaLcTAgKg+SDhZMrKXh1OS/vLxiDVhuTyG2saefECeu2qfWZH oAUGLSkonqib8Nyz72hQTXihe/fYO9Hxm9ykJmLP2YyxwSJ73qjhAJaeBQjhNcR+ rBwiSx7Lh5ErGfS0uMzSJ/0lZyvEEDQ8eE1myuNhASj5TFArOamvPT7ZSF3LtNZC MFrMDolNbtKkA4N+jura/OKsD18Y2KmboxpWCUym9LemgSu0enYwJvn5Od8KHAS8 LbN3F19/CDYiKFwAST2DdIEGaUq40uD2Omw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudeikedgvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfevfhfhjggtgfesth ejredttdefjeenucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehg uhhtohhvrdguvghvqeenucggtffrrghtthgvrhhnpeeigfetveehveevffehledtueekie eikeeufeegudfgfeeghfdulefgfeevledvveenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 30 Nov 2023 19:18:01 -0500 (EST) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=66.111.4.29; envelope-from=dmitry@gutov.dev; helo=out5-smtp.messagingengine.com X-Spam_score_int: -49 X-Spam_score: -5.0 X-Spam_bar: ----- X-Spam_report: (-5.0 / 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, NICE_REPLY_A=-2.177, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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:313409 Archived-At: On 30/11/2023 05:37, Richard Stallman wrote: > [[[ 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. ]]] > > > I guess that's the point I wanted to underscore: that those pcase uses > > are more-or-less optimal in terms of complexity (for its ultimate > > goals), that in most cases it comes from the problem domain rather than > > from the solution. > > I think the way you measure "complexity" is different from the way I > measure it. I suspect that your measure does not count the complexity > of learning `pcase' -- that it assumes the reader knows that already. > > That complexitu is what I am trying to eliminate. > > I also think that you measure "complexity" as the opposite of terseness, > so that a couple of uses of `match-set' is in your view "added complexity". > However, terseness is what makes `pcase' more complex. You haven't posted your conversion, but I suspect it was not just less terse, but it also forced the programmer to repeat the same sets of information: first, in the predicate, to check that the value has a certain structure, and then in the matcher, to deconstruct the structure and create a set of variable bindings. This repetition both adds verbosity and increases the chance to make a mistake in one of the two places. But once you eliminate it, I believe the result has to look like a more verbose pcase. Choosing an new syntax should be possible (indeed, somebody posted a link to a similar construct in Racket which is more wordy), but then those who don't like high-level constructs probably won't like it either.