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: Installing cond* in core Date: Mon, 29 Jan 2024 22:58:34 -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="37245"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jan 30 04:58:55 2024 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 1rUfGw-0009US-BO for ged-emacs-devel@m.gmane-mx.org; Tue, 30 Jan 2024 04:58:54 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUfGf-00089X-Tu; Mon, 29 Jan 2024 22:58:37 -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 1rUfGe-00088Q-70 for emacs-devel@gnu.org; Mon, 29 Jan 2024 22:58:36 -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 1rUfGd-0001FU-Sz; Mon, 29 Jan 2024 22:58:35 -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=rKtECzdJpgl1V25zVxOkaqdBYga9l2R8rYH6+Vyw18E=; b=LyzD4bNOb1F2 2T7Dlphu96rjlI8w1lpJWhY6IqR78dF5a2giBeF0XKtI5afHS7ibA3RQUbtxNcN2MwnbOWUsj7rZk /AfgLLuGtJSi7kMTDyI0Dzhx6x6EPTesdhnc3LxtgqBrscNbpaaMNG2MuKoseVHV2q8Qb++yMyH3m LGvnr4c9G7WAaLTfj0rNm+yB2jQFNgu27dJZwFnLfrcIIjidYi0OQ64CThNWjpR9zKc5NvrSGZfgy B/u8/wiB0Y0xsKpuuuJ6RxmuBv7JETkrAGG6MqC9fU1wKaC/KvoRo1zH1lsZTZQIu9z0ycc+02/rV xuqX1uTIrTMPQct1HO7PnQ==; Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1rUfGc-0000Re-6I; Mon, 29 Jan 2024 22:58:34 -0500 In-Reply-To: (message from Stefan Kangas on Sat, 27 Jan 2024 13:36:50 -0800) 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:315627 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. ]]] > After careful consideration and off-line discussions between Eli and > myself, we have come up with the following proposed plan: > 1. We will install cond* in core and let people who prefer it use it, > while people who prefer pcase are free to keep using pcase. > 2. cond* vs pcase is to be considered a matter of stylistic preference. > 3. There is no intention to forcibly replace pcase with cond* in our > code. I think that is a good plan. I would not propose to eliminate pcase, or obsolete it, because that would break things and there is no good reason to do that. > In general, there is no point to loading something early unless it is > used early. Do you have something more specific in mind? If people use it where they wish, it will get used in some files that are loaded early. Putting it in emacs-lisp should not require any special effort. I think the code generated by `cond*' calls only C-level primitives, except in one special case. That special case is when the `rx' construct is used and match subsequences are extracted as strings. Then it generates calls to `match-string' which is in subr.el. It won't be hard to avoid regexp matching in code loaded that early. Indeed, I would be surprised to see any use for it at that point. There should be no need to preload cond* because it defines no run-time support. All its work is done at macroexpand time. Perhaps there will be an issue about using it in *non-compiled* files that are loaded early. Is any such file complex enough to want to use constructs such as cond* or pcase? -- 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)