From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp? Date: Sun, 03 Sep 2023 07:42:13 +0300 Message-ID: <83r0nf98be.fsf@gnu.org> References: <834jkca9k0.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28618"; mail-complaints-to="usenet@ciao.gmane.io" Cc: stefankangas@gmail.com, emacs-devel@gnu.org, mattiase@acm.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Sep 03 06:43:10 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 1qcex3-0007FT-Hk for ged-emacs-devel@m.gmane-mx.org; Sun, 03 Sep 2023 06:43:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qcewZ-0006JU-Q3; Sun, 03 Sep 2023 00:42:39 -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 1qcewV-0006JL-TE for emacs-devel@gnu.org; Sun, 03 Sep 2023 00:42:36 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qcewU-0003IW-Fx; Sun, 03 Sep 2023 00:42:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=MrzGD4L9oNuC+juJFbxe+w6a/uGx7sCnMblRUAEjKSU=; b=OA6FhlUBZR+j JOFd+Ex66eNcLS+xsQHO8aH5Xs5skJGFuEnOGoAFfuSqV/iJ8dFLgqd4eAa1HDqq1gvX9ZKflrsS3 QHsGxXrmE8QwdptOcbA1psaI9pnTGWN5/xPgNqPzAYNSuAtISLKSrhncWPawEw2NFuAfquOXzKpWC 4smafEHpSDIQXDERVdiuMaxN1986AIfkrZ3TKcWNr4yTkYPofzuPgg7rNN0gJcDmjCirj2jqq6IIn 0ydMQK1VJqToUElGGDPlf1BLGLa1cKfjLPLbXADLxL0ROtXjw16KZiIGECfkwwmy1yvC07zEYAGkA mvpUwepaXVqEKi+GEBlPXA==; In-Reply-To: (message from Alan Mackenzie on Sat, 2 Sep 2023 19:43:29 +0000) 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:309930 Archived-At: > Date: Sat, 2 Sep 2023 19:43:29 +0000 > Cc: stefankangas@gmail.com, emacs-devel@gnu.org, mattiase@acm.org > From: Alan Mackenzie > > > > ++++ > > > +** There is now conditional compilation, based on the C language's #if. > > > +To use this, see the new macro 'static-if'. > > > Same here. Here, it is actually worse: "based on C language's #if" > > could be misinterpreted as meaning the implementation is based on #if > > in some way. I would suggest the following text in NEWS: > > > ** New macro 'static-if' for conditional byte-compilation of code. > > This macro hides a form from the byte-compiler based on a > > compile-time condition. This is handy for avoiding byte-compilation > > warnings about code that will never actually run under some > > conditions. > > static-if actually works for interpreted compilation as well as byte > compilation, so I've removed two "byte-"s from your text, leaving: > > +++ > ** New macro 'static-if' for conditional compilation of code. > This macro hides a form from the compiler based on a compile-time > condition. This is handy for avoiding byte-compilation warnings about > code that will never actually run under some conditions. What is "interpreted compilation" in Emacs? I'm aware of only two compilers in Emacs: the byte compiler and the native compiler. So when you talk about "the compiler" above, what does that allude to? > I think it's now ready to commit, except .... > > I've had some private email which suggested that perhaps static-if > should not include the condition-case which copes with an ancient eval > from before lexical binding. I can see some merit in the argument > (lexical binding happened in 24.1, I think), but on the other hand, that > extreme backwards compatibility doesn't really cost us anything > (static-if is just 13 lines of code). > > What do you think? I don't think I understand the issue: it was discussed in private email , and you didn't tell enough for me to understand and form an opinion. What do you mean by "condition-case which copes with an ancient eval from before lexical binding"?