From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: tomas@tuxteam.de Newsgroups: gmane.emacs.devel 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 Message-ID: References: <878r9lw4h1.fsf@localhost> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="l2Brsq0AV7miAkDM" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32621"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 05 08:29:08 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qdPYh-0008HE-5M for ged-emacs-devel@m.gmane-mx.org; Tue, 05 Sep 2023 08:29:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qdPY5-0000JQ-B1; Tue, 05 Sep 2023 02:28:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qdPXy-0000If-Ox for emacs-devel@gnu.org; Tue, 05 Sep 2023 02:28:25 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qdPXv-0000sj-Aa for emacs-devel@gnu.org; Tue, 05 Sep 2023 02:28:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject :Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=HAPU7VHaSqY11u5EkCeV+v8ArUfGAWGRqqZ3oer/OHU=; b=TrZ6JJw/R6Dl56xWjxBz0M3I5U g03DAHsF2oOqH+3h3/Kqnf8fe9uH9uc64B3nN5SjMgoSKHgt1CVMcJFwZSjgLV5/cxsEvhimmUqC6 7aAKTCBmEFduLgDKIqKLFUn/SWuUE+p0mYWGzv9q9QVDZj1mp+BGQfsnzkpvDSxa2a7LHBBwnTHKG BTE1m6Bc7A+P6TFWLISGRXFEBTkyuIT7AhaM8r1XMEjkmYJCGfKiodZc0A29jq6tC+CzyEqTer0zq iPEArJP9McEjgUW5ZLw2wDXtULkehnNCx2WTU4BuE1b00ZSMVVgIfVp3rjjNRi8Zrji1S1I3brCfz GM1iR4lQ==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.94.2) (envelope-from ) id 1qdPXr-00066h-Hc; Tue, 05 Sep 2023 08:28:15 +0200 Content-Disposition: inline In-Reply-To: <878r9lw4h1.fsf@localhost> Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:310112 Archived-At: --l2Brsq0AV7miAkDM Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 05, 2023 at 05:53:30AM +0000, Ihor Radchenko wrote: > writes: >=20 > > 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. >=20 > 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 --=20 t --l2Brsq0AV7miAkDM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZPbKeAAKCRAFyCz1etHa Rg5KAJ9A0a3Cw28yE8+JGneSehLo0wyCAgCfdlxpncVVQGL3XPriJL/QuwDeG8g= =8Frd -----END PGP SIGNATURE----- --l2Brsq0AV7miAkDM--