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 have a #if .... #else .... #endif construct in Emacs Lisp, when we could make the existing code DTRT unchanged? Date: Sat, 09 Sep 2023 20:24:34 -0400 Message-ID: References: <87pm2te624.fsf@yahoo.com> 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="39246"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, ulm@gentoo.org, emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Sep 10 02:24:50 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 1qf8Ft-0009zh-IO for ged-emacs-devel@m.gmane-mx.org; Sun, 10 Sep 2023 02:24:49 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qf8Fg-0004TN-Tx; Sat, 09 Sep 2023 20:24:36 -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 1qf8Fe-0004Sk-UL for emacs-devel@gnu.org; Sat, 09 Sep 2023 20:24:34 -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 1qf8Fe-0008Q5-Ik; Sat, 09 Sep 2023 20:24:34 -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=InEJMTT6VPMTTtP1AYCD+4n4rC8ZOeqJLffFOXqv+qY=; b=NpW5H4FOYdsO fiV8ebICNufaBERBbdanxQTzur7HQWL+BoS0dVqeVTKHF0o/36j0GSGNxxGl36PdurrHGBGA/pFkD Tsl/tecxm3pxz4RCg0yew+hlbmDDu6Tn1QtY0DkdPkkIzwtKFpCOZKNxI7CcYeMiqoRRBgp3W5XPl Pk2nI3IevQx6jxQ2GX/4e0wNZwDyBcNBUTOZToFUBsgzcHwiylOn9p35/0+mb7mTZ3Z8OtL7qFH7V gBqletXHUt+8ySB7KbNp6kDNIivNHpqzK7uwhaIVxng6Y+09vLZVeexC6JDpn+nC8ySBJE1Pe5PJD Vi+Pkc+VPvGjuXgFTxz4Jw==; Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1qf8Fe-000160-7W; Sat, 09 Sep 2023 20:24:34 -0400 In-Reply-To: <87pm2te624.fsf@yahoo.com> (message from Po Lu on Fri, 08 Sep 2023 10:45:39 +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:310427 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. ]]] > That's already a fait accompli: static-if was introduced several days > ago. If the compiler optimization I proposed and the static-if function give the same results, the compiler optimization is cleaner. We should use that rather than change the code to use static-if. If they do NOT give the same results, would someone please explain why not? Adam Porter wrote: > Maybe I'm misunderstanding something, but while that idea does seem > elegant, a potential drawback of that idea would seem to be that > byte-compiled code would need to be recompiled when the user's Emacs > version changed in a relevant way, while checking at runtime would mean > that it would always behave correctly. If the package is used with different Emacs versions and not compiled for each one, then it needs to test the version condition, or the feature condition, each time it is loaded. This optimization seems intended to optimize the condition by testing it at compile time. That presumes it will be compiled for a specific Emacs. So I assumed that was the scenario. We can't have it both ways. -- 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)