[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why have a #if .... #else .... #endif construct in Emacs Lisp, when
From: |
Richard Stallman |
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 |
[[[ 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 <adam@alphapapa.net> 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)
- Re: Why have a #if .... #else .... #endif construct in Emacs Lisp, when we could make the existing code DTRT unchanged?, (continued)
- Re: Why have a #if .... #else .... #endif construct in Emacs Lisp, when we could make the existing code DTRT unchanged?, Emanuel Berg, 2023/09/04
- Re: Why have a #if .... #else .... #endif construct in Emacs Lisp, when we could make the existing code DTRT unchanged?, tomas, 2023/09/05
- Re: Why have a #if .... #else .... #endif construct in Emacs Lisp, when we could make the existing code DTRT unchanged?, Adam Porter, 2023/09/05
- Re: Why have a #if .... #else .... #endif construct in Emacs Lisp, when we could make the existing code DTRT unchanged?, Lynn Winebarger, 2023/09/05
- Re: Why have a #if .... #else .... #endif construct in Emacs Lisp, when we could make the existing code DTRT unchanged?, Alan Mackenzie, 2023/09/05