[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 08:28:15 +0200 |
On Tue, Sep 05, 2023 at 05:53:30AM +0000, Ihor Radchenko wrote:
> <tomas@tuxteam.de> writes:
>
> > 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.
>
> Not always. Sometimes, version check is necessary to work around bugs
> that exist in older Emacs.
I think I said in my original post "almost always". All generalisations
suck ;-)
But even in your example's case I'd try to come up with a test which
discriminates between the behaviours.
Now this is engineering and everything is a tradeoff. Perhaps this test
is prohibitive, perhaps it can't be done at compile time and so on.
So I do agree with your "not always".
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, 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