[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why shouldn't we have a #if .... #else .... #endif construct in Emac
From: |
tomas |
Subject: |
Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp? |
Date: |
Mon, 4 Sep 2023 13:02:03 +0200 |
On Mon, Sep 04, 2023 at 10:50:07AM +0000, Alan Mackenzie wrote:
> Hello, Richard.
>
> On Sun, Sep 03, 2023 at 21:34:08 -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?
[...]
> (static-if (fboundp 'electric-indent-local-mode) ; Emacs 24.4 or later.
> (electric-indent-local-mode (if c-electric-flag 1 0)))
>
> .. (hash-if has been renamed static-if.) It would be more work to
> replace it with
>
> (when (or (> emacs-major-version 24)
> (and (= emacs-major-version 24)
> (>= emacs-minor-version 4)))
> (electric-indent-local-mode (if c-electric-flag 1 0)))
Besides, a feature test is almost always better than a version test,
because it actually documents what the tester cares about.
Cheers
--
t
signature.asc
Description: PGP signature
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, (continued)
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Philip Kaludercic, 2023/09/02
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Stefan Monnier, 2023/09/02
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Stefan Monnier, 2023/09/02
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Richard Stallman, 2023/09/03
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Richard Stallman, 2023/09/05
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Andreas Schwab, 2023/09/06
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Alan Mackenzie, 2023/09/06
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Alan Mackenzie, 2023/09/06
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Richard Stallman, 2023/09/08
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Ihor Radchenko, 2023/09/09
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Richard Stallman, 2023/09/09