[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: |
tomas |
Subject: |
Re: Why have a #if .... #else .... #endif construct in Emacs Lisp, when we could make the existing code DTRT unchanged? |
Date: |
Tue, 5 Sep 2023 06:37:13 +0200 |
On Mon, Sep 04, 2023 at 08:30:25PM -0400, 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. ]]]
>
> > How about making the byte compiler recognize the construct
>
> > (if (< emacs-major-version NUMBER) ...)
>
> > and do this optimization on it?
>
> People seem not to have considered this seriously, but I have not seen
> any serious discussion of a drawback. What flaw or drawback do people
> see in it? It should optimize the existing the existing code with no
> change at all. Isn't that just perfect?
I did offer one: checking for a version number is actually a placeholder
for the feature your code cares about. Better be up-front in the test
and let the reader know what your code's needs are.
Cheers
--
t
signature.asc
Description: PGP signature
- Re: Why have a #if .... #else .... #endif construct in Emacs Lisp, when we could make the existing code DTRT unchanged?, Richard Stallman, 2023/09/04
- 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 <=
- 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