emacs-devel
[Top][All Lists]
Advanced

[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

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]