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: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp? Date: Sun, 03 Sep 2023 21:34:08 -0400 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="30169"; mail-complaints-to="usenet@ciao.gmane.io" Cc: ulm@gentoo.org, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 04 03:34:28 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 1qcyU0-0007bT-OL for ged-emacs-devel@m.gmane-mx.org; Mon, 04 Sep 2023 03:34:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qcyTi-0003EW-G4; Sun, 03 Sep 2023 21:34:10 -0400 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 1qcyTh-0003EH-37 for emacs-devel@gnu.org; Sun, 03 Sep 2023 21:34:09 -0400 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 1qcyTg-0004Qv-R2; Sun, 03 Sep 2023 21:34:08 -0400 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=YjSawgeaqZ4XUNMveXLmx3MsmQl0UwR+KD82UO0Z9ws=; b=Ao8eB2SuBLBw LKtkaWi/NtGXlrZEx5pxMzmk3xjOWfusuTHgVtFuj2YhFQHw+3LZvzWTPDXpLn+nahfOf+DZJUCgb +ofVpuR3loEP0DRTy0/qa1sBJuqBJ3sVYGjqGyPnx5llME19mDlCChTCxQIHREBXgukLMM1BHJ5xt 2t9vQdfrMQD9mnWDlR5k7tZr43DpidWHPO91SxtUcXzIMJ6mmc4jRTC1lizbWvjRXYwyRktOV7xZj SoIfD52OsnvzhyFaZP5cosKLSGHcHmLmHnD3FSnk3ZATv/IGwbXjxKggNFFm4rC1q3QoU+fPgujtB nRlF1Pyt06e6DRZf9O4AXg==; Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1qcyTg-0003aM-Im; Sun, 03 Sep 2023 21:34:08 -0400 In-Reply-To: (message from Alan Mackenzie on Thu, 31 Aug 2023 07:50:23 +0000) 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:310041 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. ]]] > > > > (defadvice .....)) > > > However, when evaluating the containing defun/defmacro rather than byte > > > compiling it, the irritating warning message will appear with the e-w-c > > > strategem, but not with hash-if. ;-) > > How about making the byte compiler recognize the construct > > (if (< emacs-major-version NUMBER) ...) > > and do this optimization on it? > > I think that will DTRT when compiled and when interpreted, > > and it won't require changes in the code of the programs that use it. People peopose to handle conditions about Emacs version numbers in a more optimized way. I propsed a simple syntax for that. Isn't it better> > The conditions we want to test are sometimes/frequently expressed in > terms of the (non-)existence of variables, etc. It would be > inconvenient for package maintainers to have to determine "critical" > Emacs version numbers to use. I don't dollow you, Haveb't we been talking about conditions on Emacs versions all along in this discussion? I did not propose that as a change, I carried it along. > Why do you think a more restricted test of the version number would be > better than a more general test? If people would like other tests too, I have nothing against them. The issue is how to implement whatever tests we support. If they can be done at compiler time, isn't this the better implementation? I guess I don't follow. Why do you prefer `hash-if' rather than this simple compile-time syntax? Why change the syntax rather than using the syntax we use now? -- 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)